search_readwise_highlights
Search your Readwise highlights by combining semantic vector search with precise queries on author, title, notes, or tags to find relevant passages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vector_search_term | Yes | ||
| full_text_queries | Yes |
Implementation Reference
- src/index.ts:75-78 (handler)The async handler function that executes the tool logic: makes a POST request to /api/mcp/highlights with the payload and returns the results as JSON text.
async (payload) => { const response = await this.axios.post("/api/mcp/highlights", payload); return {content: [{type: "text", text: JSON.stringify(response.data.results)}]}; } - src/index.ts:60-73 (schema)Zod schema definition for the tool's input parameters: vector_search_term (string) and full_text_queries (array of up to 8 objects with field_name enum and search_term string).
{ vector_search_term: z.string(), full_text_queries: z.array( z.object({ field_name: z.enum([ "document_author", "document_title", "highlight_note", "highlight_plaintext", "highlight_tags", ]), search_term: z.string(), }), ).max(8), - src/index.ts:58-79 (registration)Registration of the tool 'search_readwise_highlights' via this.server.tool() in the registerTools method.
this.server.tool( "search_readwise_highlights", { vector_search_term: z.string(), full_text_queries: z.array( z.object({ field_name: z.enum([ "document_author", "document_title", "highlight_note", "highlight_plaintext", "highlight_tags", ]), search_term: z.string(), }), ).max(8), }, async (payload) => { const response = await this.axios.post("/api/mcp/highlights", payload); return {content: [{type: "text", text: JSON.stringify(response.data.results)}]}; } ); - build/index.js:46-61 (registration)Built/compiled version of the tool registration with the same schema and handler logic.
this.server.tool("search_readwise_highlights", { vector_search_term: z.string(), full_text_queries: z.array(z.object({ field_name: z.enum([ "document_author", "document_title", "highlight_note", "highlight_plaintext", "highlight_tags", ]), search_term: z.string(), })).max(8), }, async (payload) => { const response = await this.axios.post("/api/mcp/highlights", payload); return { content: [{ type: "text", text: JSON.stringify(response.data.results) }] }; });