create_collection
Create a new collection in Outline Wiki to organize documents by name, description, and color for better content management.
Instructions
Create a new collection.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| description | No | ||
| color | No |
Implementation Reference
- src/lib/handlers/collections.ts:29-40 (handler)The main execution logic for the create_collection tool. It validates access, builds the payload from input args, calls the API to create the collection, and returns the result with a success message.async create_collection(args: CreateCollectionInput) { checkAccess(config, 'create_collection'); const payload: Record<string, unknown> = { name: args.name }; if (args.description) payload.description = args.description; if (args.color) payload.color = args.color; const { data } = await apiCall(() => apiClient.post<OutlineCollection>('/collections.create', payload) ); return colResult(data, MESSAGES.COLLECTION_CREATED); },
- src/lib/schemas.ts:93-97 (schema)Zod schema defining the input parameters for the create_collection tool: required name, optional description and color.export const createCollectionSchema = z.object({ name: z.string().min(1, 'Name is required'), description: z.string().optional(), color: hexColor.optional(), });
- src/lib/tools.ts:146-150 (registration)Registers the create_collection tool in the allTools array by calling createTool with name, description, and schema key, converting Zod schema to JSON schema for MCP.createTool( 'create_collection', 'Create a new collection.', 'create_collection' ),
- src/lib/handlers/index.ts:23-24 (registration)Includes the createCollectionHandlers (containing create_collection) into the combined ToolHandlers object in createAllHandlers....createCollectionHandlers(ctx), ...createCommentHandlers(ctx),