readwise_update_document
Update document metadata in Readwise Reader including title, author, summary, category, location, and publication details to maintain organized reading collections.
Instructions
Update a document in Readwise Reader
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Document ID to update | |
| title | No | New title for the document | |
| author | No | New author for the document | |
| summary | No | New summary for the document | |
| published_date | No | New published date (ISO 8601) | |
| image_url | No | New image URL for the document | |
| location | No | New location for the document | |
| category | No | New category for the document |
Implementation Reference
- The handleUpdateDocument function implements the core logic of the readwise_update_document tool by calling the Readwise client's updateDocument method.export async function handleUpdateDocument(args: any) { const client = initializeClient(); const { id, ...updateData } = args as unknown as { id: string } & UpdateDocumentRequest; const response = await client.updateDocument(id, updateData); let responseText = `Document updated successfully!\nID: ${response.data.id}\nReader URL: ${response.data.url}`; if (response.messages && response.messages.length > 0) { responseText += '\n\nMessages:\n' + response.messages.map(msg => `${msg.type.toUpperCase()}: ${msg.content}`).join('\n'); } return { content: [ { type: 'text', text: responseText, }, ], }; }
- src/tools/tool-definitions.ts:86-130 (schema)Input schema and metadata for the readwise_update_document tool, defining parameters, types, and requirements.{ name: 'readwise_update_document', description: 'Update a document in Readwise Reader', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Document ID to update', }, title: { type: 'string', description: 'New title for the document', }, author: { type: 'string', description: 'New author for the document', }, summary: { type: 'string', description: 'New summary for the document', }, published_date: { type: 'string', description: 'New published date (ISO 8601)', }, image_url: { type: 'string', description: 'New image URL for the document', }, location: { type: 'string', enum: ['new', 'later', 'shortlist', 'archive', 'feed'], description: 'New location for the document', }, category: { type: 'string', enum: ['article', 'book', 'tweet', 'pdf', 'email', 'youtube', 'podcast'], description: 'New category for the document', }, }, required: ['id'], additionalProperties: false, }, },
- src/handlers/index.ts:17-18 (registration)Registration in the tool dispatch switch statement, routing calls to the handleUpdateDocument handler.case 'readwise_update_document': return handleUpdateDocument(args);
- src/index.ts:24-26 (registration)MCP server registration providing the tools list (including this tool's schema) via ListTools handler.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:28-32 (registration)MCP server CallTool handler that invokes the tool dispatcher.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { return await handleToolCall(name, args);