quip_read_document
Read content from Quip documents using thread IDs to access and retrieve document information.
Instructions
Read the content of a Quip document by its thread ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threadId | Yes | The Quip document thread ID |
Implementation Reference
- src/index.ts:208-233 (handler)The `readDocument` method contains the core execution logic for the `quip_read_document` tool. It runs a Python script (`quip_edit.py`) with the threadId and 'read' argument to fetch the document content.private async readDocument(threadId: string) { try { console.log(`Reading document ${threadId}...`); // Execute the Python script to read the document const command = `python -u ${path.join(SCRIPTS_DIR, 'quip_edit.py')} ${threadId} read`; const { stdout, stderr } = await execAsync(command); if (stderr) { console.error(`Error reading document: ${stderr}`); throw new Error(stderr); } return { content: [ { type: 'text', text: stdout || 'Document read successfully, but no content was returned', }, ], }; } catch (error) { console.error('Error reading document:', error); throw error; } }
- src/index.ts:152-158 (handler)The switch case in the CallToolRequestSchema handler that validates input and dispatches to the `readDocument` implementation.case 'quip_read_document': { const typedArgs = args as any; if (!typedArgs.threadId) { throw new McpError(ErrorCode.InvalidParams, 'threadId is required'); } return await this.readDocument(String(typedArgs.threadId)); }
- src/index.ts:51-64 (registration)Tool registration in the ListToolsRequestSchema response, defining name, description, and input schema.{ name: 'quip_read_document', description: 'Read the content of a Quip document by its thread ID', inputSchema: { type: 'object', properties: { threadId: { type: 'string', description: 'The Quip document thread ID' } }, required: ['threadId'], }, },
- src/index.ts:54-63 (schema)The input schema defining the required `threadId` parameter for the tool.inputSchema: { type: 'object', properties: { threadId: { type: 'string', description: 'The Quip document thread ID' } }, required: ['threadId'], },