Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe ID of the document to update
titleNoNew title for the document
textNoNew content for the document in Markdown format
publishNoWhether to publish the document

Implementation Reference

  • 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
            ),
          },
        ],
      };
  • 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'],
      },
    },

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/HelicopterHelicopter/outline-mcp-server'

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