search_notes
Query and retrieve notes from NotePlan.co using a search string to quickly find relevant information directly within Claude conversations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query |
Implementation Reference
- src/index.ts:54-70 (handler)The handler function for the MCP 'search_notes' tool. It receives a query parameter, invokes noteService.searchNotes, and returns the results as a formatted text response.server.tool( 'search_notes', { query: z.string().describe('The search query'), }, async ({ query }) => { const results = noteService.searchNotes(query); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2), }, ], }; } );
- src/index.ts:56-58 (schema)Input schema validation for the search_notes tool using Zod, defining the required 'query' string parameter.{ query: z.string().describe('The search query'), },
- src/services/noteService.ts:219-226 (helper)Core helper function searchNotes that retrieves all notes via cache and filters them based on the query matching title or content (case-insensitive).function searchNotes(query: string): Note[] { const notes = getAllNotes(); const lowerQuery = query.toLowerCase(); return notes.filter(note => note.title.toLowerCase().includes(lowerQuery) || note.content.toLowerCase().includes(lowerQuery) ); }
- src/index.ts:54-70 (registration)Registration of the 'search_notes' tool in the MCP server using server.tool, including schema and handler.server.tool( 'search_notes', { query: z.string().describe('The search query'), }, async ({ query }) => { const results = noteService.searchNotes(query); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2), }, ], }; } );
- src/services/noteService.ts:440-440 (helper)Export of searchNotes function as part of noteService object.searchNotes,