Skip to main content
Glama

readwise_export_highlights

Export all highlights from Readwise with optional filtering by date, book IDs, or deletion status for bulk analysis or backup purposes.

Instructions

Export all highlights from Readwise with optional filtering. Perfect for bulk analysis or backup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatedAfterNoOnly export highlights updated after this date (ISO 8601) - useful for incremental sync
idsNoComma-separated list of book IDs to export highlights from
includeDeletedNoInclude deleted highlights in export (default: false)
pageCursorNoCursor for pagination through large exports

Implementation Reference

  • The MCP tool handler function that executes the 'readwise_export_highlights' logic: initializes client, maps args to params, calls client.exportHighlights, formats response as MCP content.
    export async function handleExportHighlights(args: any) {
      const client = await initializeClient();
      
      const params = {
        updatedAfter: args.updatedAfter,
        ids: args.ids,
        includeDeleted: args.includeDeleted,
        pageCursor: args.pageCursor,
      };
      
      const response = await client.exportHighlights(params);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Tool schema defining the name, description, and inputSchema parameters for 'readwise_export_highlights'.
    {
      name: 'readwise_export_highlights',
      description: 'Export all highlights from Readwise with optional filtering. Perfect for bulk analysis or backup.',
      inputSchema: {
        type: 'object',
        properties: {
          updatedAfter: {
            type: 'string',
            description: 'Only export highlights updated after this date (ISO 8601) - useful for incremental sync',
          },
          ids: {
            type: 'string',
            description: 'Comma-separated list of book IDs to export highlights from',
          },
          includeDeleted: {
            type: 'boolean',
            description: 'Include deleted highlights in export (default: false)',
          },
          pageCursor: {
            type: 'string',  
            description: 'Cursor for pagination through large exports',
          },
        },
        additionalProperties: false,
      },
    },
  • Import registration of the handleExportHighlights function from highlights-handlers.js into the main handler dispatcher.
    import {
      handleListHighlights,
      handleCreateHighlight,
      handleExportHighlights,
      handleGetDailyReview,
      handleListBooks,
      handleGetBookHighlights,
      handleSearchHighlights,
    } from './highlights-handlers.js';
  • Dispatch registration in the main handleToolCall switch statement mapping tool name to handler.
    case 'readwise_export_highlights':
      return handleExportHighlights(args);
  • Core helper method in ReadwiseClient that makes the actual API request to Readwise /export/ endpoint with query parameters, handles errors including rate limits.
    async exportHighlights(params: ExportHighlightsParams = {}): Promise<APIResponse<ExportHighlightsResponse>> {
      try {
        const searchParams = new URLSearchParams();
        
        Object.entries(params).forEach(([key, value]) => {
          if (value !== undefined) {
            searchParams.append(key, String(value));
          }
        });
    
        const query = searchParams.toString();
        const endpoint = `/export/${query ? `?${query}` : ''}`;
        
        const result = await this.makeRequest<ExportHighlightsResponse>(endpoint, {}, true);
        return this.createResponse(result);
      } catch (error) {
        if (error instanceof Error && error.message.startsWith('RATE_LIMIT:')) {
          const seconds = parseInt(error.message.split(':')[1], 10);
          throw new Error(`Rate limit exceeded. Too many requests. Please retry after ${seconds} seconds.`);
        }
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'bulk' export and 'optional filtering', but doesn't describe critical behaviors like pagination handling (though hinted by the 'pageCursor' parameter), rate limits, authentication requirements, export format, or whether this is a read-only operation. The description is insufficient for a tool with 4 parameters and no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the core functionality, and the second suggests use cases. There's no wasted text, though it could be slightly more informative without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the export format (e.g., JSON, CSV), pagination behavior, error handling, or how the filtering parameters interact. The mention of 'bulk' hints at scale but lacks specifics, leaving significant gaps for an AI agent to understand the tool's full behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value beyond the schema by mentioning 'optional filtering' and 'bulk analysis', but doesn't provide additional semantic context about parameter interactions or usage patterns. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Export all highlights') and resource ('from Readwise'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'readwise_list_highlights' or 'readwise_search_highlights', which also retrieve highlights but with different approaches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'optional filtering' and suggests use cases ('bulk analysis or backup'), but provides no explicit guidance on when to use this tool versus alternatives like 'readwise_list_highlights' or 'readwise_search_highlights'. There's no mention of prerequisites, limitations, or comparative advantages.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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