readwise_delete_document
Remove a document from Readwise Reader by specifying its unique ID. This tool allows users to manage their reading list by deleting unwanted or outdated documents directly.
Instructions
Delete a document from Readwise Reader
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Document ID to delete |
Implementation Reference
- The main handler function that executes the deletion of a document by ID using the Readwise client and formats the response.export async function handleDeleteDocument(args: any) { const client = initializeClient(); const { id } = args as { id: string }; const response = await client.deleteDocument(id); let responseText = `Document ${id} deleted successfully!`; 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, }, ], }; }
- The input schema defining the parameters for the readwise_delete_document tool, requiring a document ID.{ name: 'readwise_delete_document', description: 'Delete a document from Readwise Reader', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Document ID to delete', }, }, required: ['id'], additionalProperties: false, }, },
- src/handlers/index.ts:20-21 (registration)The switch case in the main tool handler that routes calls to readwise_delete_document to the handleDeleteDocument function.case 'readwise_delete_document': return handleDeleteDocument(args);