delete_item
Remove items from the Skeleton MCP Server by specifying their unique identifier. This tool helps manage data by deleting specific entries when they are no longer needed.
Instructions
Delete an item.
Args: item_id: The unique identifier of the item to delete
Returns: A confirmation message
Raises: ValueError: If the item is not found
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes |
Implementation Reference
- src/skeleton_mcp/api/example.py:188-210 (handler)The handler function for the 'delete_item' tool. It takes an item_id, checks if it exists in mock storage, deletes it, and returns a confirmation dictionary.async def delete_item(item_id: str) -> dict[str, Any]: """ Delete an item. Args: item_id: The unique identifier of the item to delete Returns: A confirmation message Raises: ValueError: If the item is not found """ # In a real implementation: # client = get_client() # return client.delete(f"items/{item_id}") if item_id not in MOCK_ITEMS: raise ValueError(f"Item not found: {item_id}") del MOCK_ITEMS[item_id] return {"status": "deleted", "id": item_id}
- src/skeleton_mcp/server.py:93-93 (registration)Registers the delete_item function from the example API module as an MCP tool.mcp.tool()(example.delete_item)