create_collection
Create a new collection in Outline wiki to organize documents, enabling structured content management and grouping related materials.
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 handler function for the 'create_collection' tool. It validates access, constructs 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 for create_collection tool: name (required), description and color (optional).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)Registration of the 'create_collection' tool in the allTools array, providing name, description, and linking to the Zod schema via createTool function.createTool( 'create_collection', 'Create a new collection.', 'create_collection' ),
- src/lib/handlers/index.ts:23-24 (registration)The createCollectionHandlers (which includes create_collection) is spread into the combined ToolHandlers object in createAllHandlers....createCollectionHandlers(ctx), ...createCommentHandlers(ctx),
- src/lib/schemas.ts:233-233 (schema)The create_collection schema is mapped in the toolSchemas record used for tool definitions.create_collection: createCollectionSchema,