Fix(mcp): make declared schemas match what the handlers return
Several tool contracts disagreed with the runtime shape, which forces an
agent to guess instead of following outputSchema:
- get_server_status returned {"status": {...}} while outputSchema has the
fields at top level; return the status object directly.
- get_screenshot description claimed structuredContent.image carries the
base64 data; it only carries mimeType/width/height/bytes, the bytes are
in the content image block.
- host_control_service accepted service_name silently, but not in schema;
document the alias and add anyOf [{required:[name]},{required:[service_name]}]
so a call missing both fails at validation, not at execution.
- kill_network_connection dry_run invented dryRun/connection fields absent
from ActionOutputSchema; use the shared BuildDryRunResult shape.
- search_file outputSchema left files.items untyped; declare
path/name/modified/dir/size and the paging fields it already emits.
- chat_* id hints still named the removed list_online_hosts/search_hosts.
tools.json hunks keep the live-dump key order (alphabetical inside schemas),
tools_minimal.json is regenerated, and mcp_smoke.ps1 now reads the flat
structuredContent. Debug build green; check_platform_table, gen_go_tools
--check and go test ./... pass.
Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
5e012019ba
commit
292c3191dc
7 files changed
+93
-23
No files matched your search
@@ -175,7 +175,7 @@ Json::Value OutputSchema(Json::Value props, std::initializer_list<const char*> r
|
||||
}
|
||||
|
||||
Json::Value HostIdProp() {
|
||||
return PropStr(u8"主机 id,取 list_online_hosts / search_hosts 返回的 id 字段");
|
||||
return PropStr(u8"主机 id,取 list_hosts 返回的 id 字段");
|
||||
}
|
||||
|
||||
Json::Value SessionIdProp() {
|
||||
|
||||
Reference in new issue
Block a user