Skip to main content
Glama

readwise_list_highlights

Retrieve and filter your saved highlights from Readwise by book, date, or other criteria to organize and review important content.

Instructions

List highlights from Readwise with optional filtering by book, date, or other criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNoNumber of results per page (default: 100, max: 1000)
pageNoPage number for pagination
book_idNoFilter highlights by specific book ID
updated__ltNoFilter highlights updated before this date (ISO 8601)
updated__gtNoFilter highlights updated after this date (ISO 8601)
highlighted_at__ltNoFilter highlights made before this date (ISO 8601)
highlighted_at__gtNoFilter highlights made after this date (ISO 8601)

Implementation Reference

  • The handler function that implements the core logic for the 'readwise_list_highlights' tool. It initializes the Readwise client, constructs query parameters from the input arguments, fetches highlights using client.listHighlights, strips the response to essential fields (id, text, note, book_id), and returns the result as formatted JSON text content.
    export async function handleListHighlights(args: any) { const client = await initializeClient(); const params = { page_size: args.page_size, page: args.page, book_id: args.book_id, updated__lt: args.updated__lt, updated__gt: args.updated__gt, highlighted_at__lt: args.highlighted_at__lt, highlighted_at__gt: args.highlighted_at__gt, }; const response = await client.listHighlights(params); // Strip to essentials const minimal = { count: response.data.count, results: response.data.results.map(h => ({ id: h.id, text: h.text, note: h.note || undefined, book_id: h.book_id })) }; return { content: [ { type: 'text', text: JSON.stringify(minimal, null, 2), }, ], }; }
  • The tool definition including name, description, and input schema specifying optional parameters for pagination, book filtering, and date ranges.
    name: 'readwise_list_highlights', description: 'List highlights from Readwise with optional filtering by book, date, or other criteria', inputSchema: { type: 'object', properties: { page_size: { type: 'number', description: 'Number of results per page (default: 100, max: 1000)', }, page: { type: 'number', description: 'Page number for pagination', }, book_id: { type: 'number', description: 'Filter highlights by specific book ID', }, updated__lt: { type: 'string', description: 'Filter highlights updated before this date (ISO 8601)', }, updated__gt: { type: 'string', description: 'Filter highlights updated after this date (ISO 8601)', }, highlighted_at__lt: { type: 'string', description: 'Filter highlights made before this date (ISO 8601)', }, highlighted_at__gt: { type: 'string', description: 'Filter highlights made after this date (ISO 8601)', }, }, additionalProperties: false, }, },
  • The switch case in the main tool dispatcher that routes 'readwise_list_highlights' calls to the handleListHighlights function.
    case 'readwise_list_highlights': return handleListHighlights(args);
  • Import statement that brings in the handleListHighlights function from highlights-handlers.js for use in the tool dispatcher.
    handleListHighlights, handleCreateHighlight, handleExportHighlights, handleGetDailyReview, handleListBooks, handleGetBookHighlights, handleSearchHighlights, } from './highlights-handlers.js';

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