list-all-notes
Retrieve all stored notes from the MCP Notes Server to access, manage, or review your persisted data efficiently using this tool.
Instructions
Read all stored notes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/notes/tools/handle_tools.py:80-103 (handler)The core handler function that executes the list-all-notes tool by fetching all notes from storage, formatting them, and returning a formatted text content list.async def _handle_list_notes(self) -> List[types.TextContent]: """Process note listing requests.""" notes = self.storage.get_all_notes() if not notes: return [ types.TextContent( type="text", text="No notes stored yet.", ) ] notes_text = "\n".join( f"- {name}:\n" f" Content: {note['content']}\n" f" Created: {note['created_at']}\n" f" Modified: {note['modified_at']}" for name, note in notes.items() ) return [ types.TextContent( type="text", text=f"All stored notes:\n{notes_text}", ) ]
- src/notes/tools/list_tools.py:23-30 (schema)Defines the tool schema with empty input properties (no arguments required) and description for list-all-notes.types.Tool( name="list-all-notes", description="Read all stored notes", inputSchema={ "type": "object", "properties": {}, }, ),
- src/notes/server.py:41-45 (registration)MCP registration endpoint for listing tools, which includes the list-all-notes tool schema via tool_list.get_tool_list().@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """Return list of available note management tools.""" return tool_list.get_tool_list()
- src/notes/tools/handle_tools.py:12-24 (registration)Tool dispatch registration in the handler class that routes 'list-all-notes' calls to the specific handler method.async def handle_tool(self, name: str, arguments: Optional[Dict]) -> List[types.TextContent]: """Route tool requests to appropriate handlers.""" if name == "add-note": return await self._handle_add_note(arguments) elif name == "update-note": return await self._handle_update_note(arguments) elif name == "delete-note": return await self._handle_delete_note(arguments) elif name == "list-all-notes": return await self._handle_list_notes() else: raise ValueError(f"Unknown tool: {name}")