Skip to main content
Glama

update_document

Modify existing Outline wiki documents by editing titles, content, or appending new information to maintain current documentation.

Instructions

Update an existing document. Can append content with append mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYes
titleNo
textNo
appendNo

Implementation Reference

  • Core handler function that performs the document update, handles append mode by fetching existing content, constructs payload, calls Outline API /documents.update, and returns formatted result.
    async update_document(args: UpdateDocumentInput) { checkAccess(config, 'update_document'); let text = args.text; if (args.append && args.text) { const { data: existing } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.info', { id: args.documentId }) ); text = (existing.text || '') + '\n\n' + args.text; } const payload: Record<string, unknown> = { id: args.documentId }; if (args.title) payload.title = args.title; if (text !== undefined) payload.text = text; const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.update', payload) ); return docResult(data, MESSAGES.DOCUMENT_UPDATED); },
  • Zod schema defining input for update_document tool: requires documentId, optional title/text/append.
    export const updateDocumentSchema = z.object({ documentId, title: z.string().min(1).optional(), text: z.string().optional(), append: z.boolean().default(false), });
  • src/lib/tools.ts:80-84 (registration)
    MCP tool registration: defines name, description, and references the Zod schema for JSON Schema conversion.
    createTool( 'update_document', 'Update an existing document. Can append content with append mode.', 'update_document' ),
  • TypeScript type inferred from the updateDocumentSchema for type safety in handlers.
    export type UpdateDocumentInput = z.infer<typeof updateDocumentSchema>;
  • Mapping of tool name to schema in the central toolSchemas record used for tool definitions.
    update_document: updateDocumentSchema,

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/huiseo/outline-smart-mcp'

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