Skip to main content
Glama

readwise_save_document

Save web documents or HTML content to Readwise Reader for organized reading and highlights management. Supports tagging, categorization, and custom storage locations.

Instructions

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

Input Schema

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

Implementation Reference

  • The main handler function that implements the logic for the 'readwise_save_document' tool. It initializes the Readwise client, casts arguments to CreateDocumentRequest, calls client.createDocument, and 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, }, ], }; }
  • The tool definition including name, description, and detailed inputSchema for validating arguments to 'readwise_save_document', specifying required 'url' and optional fields like 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, }, },
  • The switch case in handleToolCall that registers and routes calls to the 'readwise_save_document' tool to the handleSaveDocument handler function.
    case 'readwise_save_document': return handleSaveDocument(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