readwise_export_highlights
Export Readwise highlights for bulk analysis or backup, with options to filter by update date, book IDs, or include deleted entries. Supports pagination for large exports.
Instructions
Export all highlights from Readwise with optional filtering. Perfect for bulk analysis or backup.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | Comma-separated list of book IDs to export highlights from | |
| includeDeleted | No | Include deleted highlights in export (default: false) | |
| pageCursor | No | Cursor for pagination through large exports | |
| updatedAfter | No | Only export highlights updated after this date (ISO 8601) - useful for incremental sync |
Implementation Reference
- The main handler function that executes the readwise_export_highlights tool. Initializes the Readwise client and calls the exportHighlights API method with the provided parameters, returning the JSON response.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), }, ], }; }
- The tool definition including name, description, and input schema for validating arguments to 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, }, },
- src/handlers/index.ts:45-46 (registration)Registration of the tool in the main handler switch statement, mapping 'readwise_export_highlights' to the handleExportHighlights function.case 'readwise_export_highlights': return handleExportHighlights(args);