Skip to main content
Glama
huiseo
by huiseo

create_document

Create new documents in Outline wiki by specifying title, content, collection, and optional parent document for organized knowledge management.

Instructions

Create a new document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
textNo
collectionIdYes
parentDocumentIdNo
publishNo

Implementation Reference

  • The core handler function that implements the create_document tool by calling the Outline API to create a new document.
    async create_document(args: CreateDocumentInput) {
      checkAccess(config, 'create_document');
      const { data } = await apiCall(() =>
        apiClient.post<OutlineDocument>('/documents.create', {
          title: args.title,
          text: args.text,
          collectionId: args.collectionId,
          parentDocumentId: args.parentDocumentId,
          publish: args.publish,
        })
      );
      return docResult(data, MESSAGES.DOCUMENT_CREATED);
    },
  • Zod schema defining the input parameters for the create_document tool.
    export const createDocumentSchema = z.object({
      title: z.string().min(1, 'Title is required'),
      text: z.string().default(''),
      collectionId,
      parentDocumentId: z.string().uuid().optional(),
      publish: z.boolean().default(true),
    });
  • Registration of document handlers (including create_document) into the combined ToolHandlers object used by the MCP server.
    export function createAllHandlers(ctx: AppContext): ToolHandlers {
      return {
        ...createSearchHandlers(ctx),
        ...createDocumentHandlers(ctx),
        ...createCollectionHandlers(ctx),
        ...createCommentHandlers(ctx),
        ...createBatchHandlers(ctx),
        ...createSmartHandlers(ctx),
      } as ToolHandlers;
    }
  • src/lib/tools.ts:76-79 (registration)
    MCP tool definition registration, specifying name, description, and schema reference for create_document.
      'create_document',
      'Create a new document.',
      'create_document'
    ),
  • src/index.ts:84-86 (registration)
    Instantiates the app context and creates the handlers object (including create_document handler) for MCP tool execution.
    const ctx = createAppContext(config);
    const handlers = createAllHandlers(ctx);

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-wiki-mcp'

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