Skip to main content
Glama

readwise_get_book_highlights

Retrieve all highlights from a specific book in your Readwise library by providing the book ID, enabling quick access to key passages and insights.

Instructions

Get all highlights from a specific book

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookIdYesThe ID of the book to get highlights from

Implementation Reference

  • The core handler function for the readwise_get_book_highlights tool. It initializes the Readwise client, fetches all highlights for the given bookId using the SDK client, strips the response to essential fields (id, text, note), and returns the data as a JSON-formatted text content block for MCP response.
    export async function handleGetBookHighlights(args: any) { const client = await initializeClient(); const response = await client.getBookHighlights(args.bookId); // Strip to essentials const minimal = response.data.map(h => ({ id: h.id, text: h.text, note: h.note || undefined })); return { content: [ { type: 'text', text: JSON.stringify(minimal, null, 2), }, ], }; }
  • The tool definition including input schema for readwise_get_book_highlights, requiring a numeric bookId parameter.
    { name: 'readwise_get_book_highlights', description: 'Get all highlights from a specific book', inputSchema: { type: 'object', properties: { bookId: { type: 'number', description: 'The ID of the book to get highlights from', }, }, required: ['bookId'], additionalProperties: false, }, },
  • Import statement registering the handleGetBookHighlights handler function from highlights-handlers.ts into the main tool dispatcher.
    import { handleListHighlights, handleCreateHighlight, handleExportHighlights, handleGetDailyReview, handleListBooks, handleGetBookHighlights, handleSearchHighlights, } from './highlights-handlers.js';
  • Switch case in the main handleToolCall function that registers and dispatches 'readwise_get_book_highlights' tool calls to the handler.
    case 'readwise_get_book_highlights': return handleGetBookHighlights(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arnaldo-delisio/readwise-mcp-enhanced'

If you have feedback or need assistance with the MCP directory API, please join our Discord server