feat(mcp): add delete_design tool
Wires DELETE /api/v1/designs/{id} into the MCP layer.
The backend already implements the endpoint and prevents
deleting the last remaining design.
- mcp/app/tools.py: Tool schema + _dispatch case
- mcp/tests/test_tools.py: 2 new tests (dispatch + schema)
30/30 tests passing.
This commit is contained in:
@@ -163,6 +163,13 @@ def _build_tools() -> list[Tool]:
|
||||
"design_type": {"type": "string", "description": "Design type (default: network)."},
|
||||
},
|
||||
}),
|
||||
Tool(name="delete_design", description="Delete a design (canvas) and all its nodes and edges. The last remaining design cannot be deleted.", inputSchema={
|
||||
"type": "object",
|
||||
"required": ["design_id"],
|
||||
"properties": {
|
||||
"design_id": {"type": "string", "description": "ID of the design to delete. Call list_designs to discover IDs."},
|
||||
},
|
||||
}),
|
||||
]
|
||||
|
||||
|
||||
@@ -272,4 +279,7 @@ async def _dispatch(name: str, args: dict) -> dict:
|
||||
if name == "create_design":
|
||||
return await backend.post("/api/v1/designs", args)
|
||||
|
||||
if name == "delete_design":
|
||||
return await backend.delete(f"/api/v1/designs/{args['design_id']}")
|
||||
|
||||
raise ValueError(f"Unknown tool: {name}")
|
||||
|
||||
Reference in New Issue
Block a user