create_document
Create new documents in Outline wiki with required title and collection ID, supporting text content, hierarchical organization, and publishing options.
Instructions
Create a new document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| text | No | ||
| collectionId | Yes | ||
| parentDocumentId | No | ||
| publish | No |
Implementation Reference
- src/lib/handlers/documents.ts:56-68 (handler)The handler function that implements the core logic of the 'create_document' tool by calling the Outline API to create a new document with the provided title, text, collection, parent, and publish settings.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); },
- src/lib/schemas.ts:42-48 (schema)Zod schema defining the input validation for the 'create_document' tool, including title (required), text, collectionId, parentDocumentId, and publish flag.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), });
- src/lib/tools.ts:75-79 (registration)Registration of the 'create_document' tool definition, including name, description, and reference to its Zod schema for MCP tool protocol.createTool( 'create_document', 'Create a new document.', 'create_document' ),
- src/lib/schemas.ts:220-220 (schema)Mapping of 'create_document' tool name to its schema in the central toolSchemas record.create_document: createDocumentSchema,
- src/lib/handlers/index.ts:22-22 (registration)Inclusion of document handlers (including create_document) into the combined ToolHandlers object....createDocumentHandlers(ctx),