feat(mcp): serve specialist guides on demand and shorten instructions

This commit is contained in:
Karim Jerbi committed 2026-10-12 15:20:28 +01:00
1 parent 50030be8c2
commit 8943a6fd39
5 files changed
+169 -6

No files matched your search

+21
View File
@@ -114,6 +114,27 @@ def legacy(server: Path) -> None:
})
assert missing_batch["result"]["isError"] is True
assert "absent or expired" in missing_batch["result"]["content"][0]["text"]
guides = request(process, {
"jsonrpc": "2.0", "id": "guides", "method": "resources/list",
})
guide_uris = {r["uri"] for r in guides["result"]["resources"]
if r["uri"].startswith("cad://guides/")}
assert guide_uris == {f"cad://guides/{name}" for name in
("workflow", "architecture", "capture", "batch-bindings")}
for uri in sorted(guide_uris):
resource = request(process, {
"jsonrpc": "2.0", "id": uri, "method": "resources/read", "params": {"uri": uri},
})
assert resource["result"]["contents"][0]["text"].startswith("# ")
guide_tool = request(process, {
"jsonrpc": "2.0", "id": "guide-tool", "method": "tools/call",
"params": {"name": "ocs_read", "arguments": {
"ocs_session_id": "offline", "op": "guide", "parameters": {"name": "capture"},
}},
})
assert not guide_tool["result"].get("isError"), guide_tool
assert guide_tool["result"]["structuredContent"]["ok"] is True
assert "resource_link" in guide_tool["result"]["structuredContent"]["contents"][0]["text"]
close(process)