Skip to main content
Glama

readwise_delete_document

Remove a document from Readwise Reader by specifying its document ID to manage your reading list and content library.

Instructions

Delete a document from Readwise Reader

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDocument ID to delete

Implementation Reference

  • The `handleDeleteDocument` function implements the core logic for the `readwise_delete_document` tool. It initializes the Readwise client, destructures the document ID from args, calls `client.deleteDocument(id)`, processes any messages, and returns a standardized MCP response with success confirmation.
    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 tool definition including name, description, and input schema for `readwise_delete_document`, requiring a single `id` string parameter.
    {
      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,
      },
    },
  • Switch case in the main `handleToolCall` function that routes calls to `readwise_delete_document` to the `handleDeleteDocument` handler.
    case 'readwise_delete_document':
      return handleDeleteDocument(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