Skip to main content
Glama

readwise_save_document

Save documents, URLs, or HTML content directly to Readwise Reader, organize with tags, specify categories, and choose storage locations for efficient content management.

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 handleSaveDocument function that executes the core logic of the readwise_save_document tool. Initializes the Readwise client, creates the document using client.createDocument, formats a success response with document details and any messages.
    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, }, ], }; }
  • Input schema and metadata definition for the readwise_save_document tool, including parameters like url (required), html, tags, location, category.
    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, }, },
  • Tool dispatch registration in the main handleToolCall switch statement, mapping 'readwise_save_document' to the handleSaveDocument handler.
    case 'readwise_save_document': return handleSaveDocument(args);
  • src/index.ts:24-26 (registration)
    MCP server registration of all tools list (including readwise_save_document schema) via ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • src/index.ts:28-33 (registration)
    MCP server registration of tool call handler, which dispatches to handleToolCall for executing readwise_save_document.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { return await handleToolCall(name, args); } catch (error) {

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