export_collection
Export Outline wiki collections to Markdown or JSON formats for backup, migration, or external use.
Instructions
Export a collection.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes | ||
| format | No | outline-markdown |
Implementation Reference
- src/lib/handlers/collections.ts:64-75 (handler)The main handler function for the 'export_collection' tool. It calls the Outline API to start exporting the specified collection in the given format and returns a success response with file operation details.async export_collection(args: ExportCollectionInput) { const { data } = await apiCall(() => apiClient.post<unknown>('/collections.export', { id: args.collectionId, format: args.format }) ); return { success: true, collectionId: args.collectionId, format: args.format, fileOperation: data, message: MESSAGES.COLLECTION_EXPORT_STARTED, }; },
- src/lib/schemas.ts:107-107 (schema)Zod schema definition for 'export_collection' tool input, requiring a UUID collectionId and optional export format (default 'outline-markdown').export const exportCollectionSchema = z.object({ collectionId, format: exportFormat });
- src/lib/schemas.ts:193-193 (schema)TypeScript type derived from the exportCollectionSchema for use in handlers.export type ExportCollectionInput = z.infer<typeof exportCollectionSchema>;
- src/lib/tools.ts:161-165 (registration)Registration of the 'export_collection' tool in the allTools array, converting the Zod schema to JSON Schema for MCP.createTool( 'export_collection', 'Export a collection.', 'export_collection' ),
- src/lib/schemas.ts:236-236 (registration)Entry in the toolSchemas map that associates 'export_collection' with its Zod schema.export_collection: exportCollectionSchema,