forked from 1b-agent/opencadstudio-upstream
feat(mcp): expose entity creation schemas on demand
Expose creation fields, constraints and examples for the 11 supported types without expanding startup tool schemas. Share the creation contract and constructor with execution to keep accepted inputs consistent. Validation: MCP, contract/factory and entity creation regression tests.
This commit is contained in:
1 parent
a5435a6df6
commit
97afb57333
10 files changed
+1118
-488
No files matched your search
@@ -135,6 +135,15 @@ def legacy(server: Path) -> None:
|
||||
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"]
|
||||
entity_schema = request(process, {
|
||||
"jsonrpc": "2.0", "id": "entity-schema", "method": "tools/call",
|
||||
"params": {"name": "ocs_read", "arguments": {
|
||||
"op": "entity_schema", "parameters": {"type": "Circle"},
|
||||
}},
|
||||
})
|
||||
assert not entity_schema["result"].get("isError"), entity_schema
|
||||
contract = entity_schema["result"]["structuredContent"]["schema"]
|
||||
assert contract["required"] == ["type", "center", "radius"]
|
||||
close(process)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user