Skip to main content
Glama
edricgsh

Readwise Reader MCP Server

by edricgsh

readwise_save_document

Save articles, PDFs, or other content from URLs or HTML to Readwise Reader, tagging and organizing them into categories like articles, books, or podcasts for easy access.

Instructions

Save a document (URL or HTML content) to Readwise Reader

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoCategory of the document (auto-detected if not specified)
htmlNoHTML content of the document (optional)
locationNoLocation to save the document (default: new)
tagsNoTags to add to the document
urlYesURL of the document to save

Implementation Reference

  • The core handler function that executes the readwise_save_document tool. It initializes the Readwise client and calls createDocument with the input arguments, then formats the response.
    export async function handleSaveDocument(args: any) { const client = initializeClient(); const data = args as unknown as CreateDocumentRequest; const response = await client.createDocument(data); let responseText = `Document saved successfully!\nID: ${response.data.id}\nTitle: ${response.data.title || 'Untitled'}\nURL: ${response.data.url}\nLocation: ${response.data.location}`; 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, }, ], }; }
  • Dispatches tool calls to specific handlers; maps 'readwise_save_document' to handleSaveDocument.
    export async function handleToolCall(name: string, args: any) { switch (name) { case 'readwise_save_document': return handleSaveDocument(args); case 'readwise_list_documents': return handleListDocuments(args); case 'readwise_update_document': return handleUpdateDocument(args); case 'readwise_delete_document': return handleDeleteDocument(args); case 'readwise_list_tags': return handleListTags(args); case 'readwise_topic_search': return handleTopicSearch(args); default: throw new Error(`Unknown tool: ${name}`); } }
  • Defines the tool schema including name, description, and inputSchema for validation.
    { name: 'readwise_save_document', description: 'Save a document (URL or HTML content) to Readwise Reader', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'URL of the document to save', }, html: { type: 'string', description: 'HTML content of the document (optional)', }, tags: { type: 'array', items: { type: 'string' }, description: 'Tags to add to the document', }, location: { type: 'string', enum: ['new', 'later', 'shortlist', 'archive', 'feed'], description: 'Location to save the document (default: new)', }, category: { type: 'string', enum: ['article', 'book', 'tweet', 'pdf', 'email', 'youtube', 'podcast'], description: 'Category of the document (auto-detected if not specified)', }, }, required: ['url'], additionalProperties: false, }, },
  • src/index.ts:28-44 (registration)
    Registers the MCP CallTool handler which invokes handleToolCall for the specified tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { return await handleToolCall(name, args); } catch (error) { return { content: [ { type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } });
  • src/index.ts:24-26 (registration)
    Registers the MCP ListTools handler which returns the list of tools including readwise_save_document.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

Other Tools

Related 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/edricgsh/Readwise-Reader-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server