outline_update_document
Modify existing Outline documents by updating titles, content, or publication status using Markdown formatting.
Instructions
Update an existing document in Outline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the document to update | |
| title | No | New title for the document | |
| text | No | New content for the document in Markdown format | |
| publish | No | Whether to publish the document |
Implementation Reference
- src/index.ts:255-271 (handler)Tool handler for outline_update_document in index.ts, which delegates to the OutlineClient.
case 'outline_update_document': return { content: [ { type: 'text', text: JSON.stringify( await this.outlineClient.updateDocument(args.id as string, { title: args.title as string, text: args.text as string, publish: args.publish as boolean, }), null, 2 ), }, ], }; - src/outline-client.ts:148-168 (handler)The implementation of the updateDocument method in the OutlineClient class, which performs the actual API call.
async updateDocument(id: string, data: { title?: string; text?: string; publish?: boolean; }): Promise<Document> { const endpoints = ['/api/documents.update', '/api/documents/update', '/api/document/update']; for (const endpoint of endpoints) { try { const response = await this.api.post(endpoint, { id, ...data }); return response.data.data || response.data; } catch (error: any) { if (error.response?.status === 404 && endpoint !== endpoints[endpoints.length - 1]) { console.error(`Endpoint ${endpoint} not found, trying next...`); continue; } throw error; } } throw new Error('No valid endpoint found for updating document'); } - src/index.ts:96-120 (registration)Registration of the 'outline_update_document' tool in the TOOLS array, including the input schema definition.
name: 'outline_update_document', description: 'Update an existing document in Outline', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The ID of the document to update', }, title: { type: 'string', description: 'New title for the document', }, text: { type: 'string', description: 'New content for the document in Markdown format', }, publish: { type: 'boolean', description: 'Whether to publish the document', }, }, required: ['id'], }, },