Skip to main content
Glama

readwise_list_books

Easily list books with highlights in Readwise using filtering options like category, source, or update date. Ideal for organizing and accessing highlighted content.

Instructions

List books that have highlights in Readwise with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter books by category
last_highlight_at__gtNoFilter books with last highlight after this date (ISO 8601)
last_highlight_at__ltNoFilter books with last highlight before this date (ISO 8601)
pageNoPage number for pagination
page_sizeNoNumber of results per page (default: 100, max: 1000)
sourceNoFilter books by source
updated__gtNoFilter books updated after this date (ISO 8601)
updated__ltNoFilter books updated before this date (ISO 8601)

Implementation Reference

  • The primary handler function that executes the 'readwise_list_books' tool. It initializes the Readwise client, maps input arguments to API parameters, calls client.listBooks(), processes the response to include essential fields (id, title, author, category, num_highlights), and returns the result as formatted JSON text content.
    export async function handleListBooks(args: any) { const client = await initializeClient(); const params = { page_size: args.page_size, page: args.page, category: args.category, source: args.source, updated__lt: args.updated__lt, updated__gt: args.updated__gt, last_highlight_at__lt: args.last_highlight_at__lt, last_highlight_at__gt: args.last_highlight_at__gt, }; const response = await client.listBooks(params); // Strip to essentials const minimal = { count: response.data.count, results: response.data.results.map(b => ({ id: b.id, title: b.title, author: b.author, category: b.category, num_highlights: b.num_highlights })) }; return { content: [ { type: 'text', text: JSON.stringify(minimal, null, 2), }, ], }; }
  • The input schema definition for the 'readwise_list_books' tool, specifying parameters for pagination, filtering by category, source, dates, etc., used for MCP tool validation.
    { name: 'readwise_list_books', description: 'List books that have highlights in Readwise with optional filtering', 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', }, category: { type: 'string', enum: ['books', 'articles', 'tweets', 'supplementals', 'podcasts'], description: 'Filter books by category', }, source: { type: 'string', description: 'Filter books by source', }, updated__lt: { type: 'string', description: 'Filter books updated before this date (ISO 8601)', }, updated__gt: { type: 'string', description: 'Filter books updated after this date (ISO 8601)', }, last_highlight_at__lt: { type: 'string', description: 'Filter books with last highlight before this date (ISO 8601)', }, last_highlight_at__gt: { type: 'string', description: 'Filter books with last highlight after this date (ISO 8601)', }, }, additionalProperties: false, }, },
  • The switch case in the main tool dispatcher (handleToolCall) that registers and routes calls to the 'readwise_list_books' handler function.
    case 'readwise_list_books': return handleListBooks(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