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:
@@ -262,6 +262,18 @@ def test_create_design_schema_requires_name():
|
||||
assert tool.inputSchema["required"] == ["name"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_delete_design(mock_backend):
|
||||
await _dispatch("delete_design", {"design_id": "d-old"})
|
||||
mock_backend.delete.assert_called_once_with("/api/v1/designs/d-old")
|
||||
|
||||
|
||||
def test_delete_design_schema_requires_design_id():
|
||||
tool = next(t for t in TOOLS if t.name == "delete_design")
|
||||
assert tool.inputSchema["required"] == ["design_id"]
|
||||
assert "design_id" in tool.inputSchema["properties"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_unknown_tool():
|
||||
with pytest.raises(ValueError, match="Unknown tool"):
|
||||
|
||||
Reference in New Issue
Block a user