delete-note
Remove an existing note by specifying its name. This tool is part of the MCP Notes Server, which manages notes with CRUD operations and resource-based access.
Instructions
Delete an existing note
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/notes/tools/handle_tools.py:63-78 (handler)Executes the 'delete-note' tool: validates input, deletes via storage, returns confirmation.async def _handle_delete_note(self, arguments: Optional[Dict]) -> List[types.TextContent]: """Process note deletion requests.""" if not arguments: raise ValueError("Missing arguments") note_name = arguments.get("name") if not note_name: raise ValueError("Missing name") deleted_note = self.storage.delete_note(note_name) return [ types.TextContent( type="text", text=f"Deleted note '{note_name}'\nLast modified: {deleted_note['modified_at']}", ) ]
- src/notes/tools/list_tools.py:43-53 (registration)Registers the 'delete-note' tool with MCP including description and input schema.types.Tool( name="delete-note", description="Delete an existing note", inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, }, "required": ["name"], }, )
- src/notes/storage.py:56-63 (helper)Core deletion logic: removes note from in-memory dict and saves to JSON file.def delete_note(self, name: str) -> dict: """Remove a note and return its data.""" if name not in self.notes: raise ValueError(f"Note '{name}' not found") deleted_note = self.notes.pop(name) self.save_notes() return deleted_note