mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-25 04:29:51 +01:00
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:
parent
942ac2fe12
commit
ef2fcdbcb1
1 changed files with 1 additions and 1 deletions
|
|
@ -107,7 +107,7 @@ class ServerMCPClient:
|
||||||
"function": {
|
"function": {
|
||||||
"name": name,
|
"name": name,
|
||||||
"description": tool.description,
|
"description": tool.description,
|
||||||
"parameters": tool.inputSchema,
|
"parameters": getattr(tool, "input_schema", None) or getattr(tool, "inputSchema", {}),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for name, tool in self.tools_dict.items()
|
for name, tool in self.tools_dict.items()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue