fix(server_mcp): read Tool.input_schema for mcp 2.3.0 (#3522)
mcp==2.3.0 Tool stores the JSON Schema on input_schema (alias inputSchema). Accessing tool.inputSchema raises AttributeError and aborts server_mcp init after a successful tools/list. Use getattr fallback so function-calling conversion works. Closes #3521 Co-authored-by: shinjiyu <shinjiyu@users.noreply.github.com>
This commit is contained in:
1 parent
942ac2fe12
commit
ef2fcdbcb1
1 file changed
+1
-1
@@ -107,7 +107,7 @@ class ServerMCPClient:
|
||||
"function": {
|
||||
"name": name,
|
||||
"description": tool.description,
|
||||
"parameters": tool.inputSchema,
|
||||
"parameters": getattr(tool, "input_schema", None) or getattr(tool, "inputSchema", {}),
|
||||
},
|
||||
}
|
||||
for name, tool in self.tools_dict.items()
|
||||
|
||||
Reference in new issue
Block a user