feat(M1): 补 de_wake/de_press_key 工具(Agent 熄屏可自唤醒);修复 MCP SDK v2 input_schema 字段警告

This commit is contained in:
2026-09-04 12:50:55 +08:00
parent 937a87b36c
commit 7017ff3315
3 changed files with 46 additions and 1 deletions
+2 -1
View File
@@ -48,7 +48,8 @@ class Agent:
tools = await self._mcp.list_tools()
self.tools_schema = []
for t in tools:
schema = t.inputSchema if hasattr(t, "inputSchema") else {}
# MCP SDK v2 改名 input_schema,兼容新旧字段
schema = getattr(t, "input_schema", None) or getattr(t, "inputSchema", {})
# fastmcp Tool 属性兼容:name/description/inputSchema
name = getattr(t, "name", "")
desc = getattr(t, "description", "") or ""