Skip to main content
Glama

quip_prepend_content

Prepend markdown content to the start of a Quip document using its thread ID. Enables AI assistants to modify documents directly via the Quip MCP Server.

Instructions

Add content to the beginning of an existing Quip document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesMarkdown content to prepend to the document
threadIdYesThe Quip document thread ID

Implementation Reference

  • Executes the quip_prepend_content tool by validating input parameters (threadId and content) and calling the shared editDocument helper method with 'PREPEND' operation.
    case 'quip_prepend_content': { const typedArgs = args as any; if (!typedArgs.threadId || !typedArgs.content) { throw new McpError(ErrorCode.InvalidParams, 'threadId and content are required'); } return await this.editDocument(String(typedArgs.threadId), String(typedArgs.content), 'PREPEND'); }
  • Input schema definition for the quip_prepend_content tool, specifying threadId and content as required string properties.
    inputSchema: { type: 'object', properties: { threadId: { type: 'string', description: 'The Quip document thread ID' }, content: { type: 'string', description: 'Markdown content to prepend to the document' } }, required: ['threadId', 'content'], },
  • src/index.ts:83-100 (registration)
    Registers the quip_prepend_content tool in the server's listTools response, including name, description, and input schema.
    { name: 'quip_prepend_content', description: 'Add content to the beginning of an existing Quip document', inputSchema: { type: 'object', properties: { threadId: { type: 'string', description: 'The Quip document thread ID' }, content: { type: 'string', description: 'Markdown content to prepend to the document' } }, required: ['threadId', 'content'], }, },
  • Shared helper method that performs the actual prepend operation (among others) by creating a temp file with the content and executing the external Python quip_edit.py script with 'prepend' argument.
    private async editDocument(threadId: string, content: string, operation: string) { try { console.log(`Editing document ${threadId} with operation ${operation}...`); // Create a temporary file to store the content const tempFilePath = `/tmp/quip_content_${Date.now()}.md`; const writeCommand = `echo "${content.replace(/"/g, '\\"')}" > ${tempFilePath}`; await execAsync(writeCommand); // Execute the Python script to edit the document const command = `python -u ${path.join(SCRIPTS_DIR, 'quip_edit.py')} ${threadId} ${operation.toLowerCase()} ${tempFilePath}`; const { stdout, stderr } = await execAsync(command); // Clean up the temporary file await execAsync(`rm ${tempFilePath}`); if (stderr) { console.error(`Error editing document: ${stderr}`); throw new Error(stderr); } return { content: [ { type: 'text', text: stdout || `Successfully ${operation.toLowerCase()}ed content to document ${threadId}`, }, ], }; } catch (error) { console.error(`Error ${operation.toLowerCase()}ing document:`, error); throw error; } }

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/AvinashBole/quip-mcp-server'

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