LibreChat/packages/api/src/tools
Serhii Zghama 7f0fde2d98
🪨 fix: Normalize Empty MCP Tool Descriptions to undefined for Bedrock Compat. (#13217)
* fix(agents): normalize empty MCP tool descriptions to undefined

MCP servers (e.g. Asana MCP) can return tools with an empty string
description. AWS Bedrock's converse API rejects toolSpec.description
with length < 1, so any empty-description MCP tool caused the entire
request to fail with a validation error.

Convert empty strings to undefined at the two sites in
loadToolDefinitions where MCP tool definitions are built. An undefined
description is omitted from JSON serialization, so Bedrock never sees
the empty value. OpenAI and Anthropic direct APIs are unaffected.

Fixes #13209

* test(agents): add coverage for empty MCP tool description normalization

Verify that loadToolDefinitions converts '' descriptions to undefined
for both the sys__all__sys pattern and directly named MCP tools.
2026-05-23 09:43:40 -04:00
..
registry 🧰 refactor: Unify code-execution tools (#12767) 2026-04-25 04:02:01 -04:00
toolkits 📌 fix: Stabilize Agent Prompt Cache Prefix (#12907) 2026-05-02 09:55:31 +09:00
classification.spec.ts 🛡️ fix: Gate Bash PTC Capabilities (#13053) 2026-05-10 21:23:02 -04:00
classification.ts 🛡️ fix: Gate Bash PTC Capabilities (#13053) 2026-05-10 21:23:02 -04:00
definitions.spec.ts 🪨 fix: Normalize Empty MCP Tool Descriptions to undefined for Bedrock Compat. (#13217) 2026-05-23 09:43:40 -04:00
definitions.ts 🪨 fix: Normalize Empty MCP Tool Descriptions to undefined for Bedrock Compat. (#13217) 2026-05-23 09:43:40 -04:00
format.spec.ts 💎 fix: Gemini Image Gen Tool Vertex AI Auth and File Storage (#11923) 2026-02-24 08:21:02 -05:00
format.ts 💎 fix: Gemini Image Gen Tool Vertex AI Auth and File Storage (#11923) 2026-02-24 08:21:02 -05:00
index.ts 🦥 refactor: Event-Driven Lazy Tool Loading (#11588) 2026-02-01 08:50:57 -05:00