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 primary handler function that implements the logic for exporting a collection by calling the Outline API endpoint '/collections.export' with the provided collection ID and format.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 defining the input for export_collection: collectionId (UUID string) and format (enum ['outline-markdown', 'json'], default 'outline-markdown'). Relies on shared fragments collectionId and exportFormat defined earlier.export const exportCollectionSchema = z.object({ collectionId, format: exportFormat });
- src/lib/tools.ts:161-165 (registration)Registers the export_collection tool by creating its MCP tool definition (name, description, input JSON Schema derived from Zod schema via createTool).createTool( 'export_collection', 'Export a collection.', 'export_collection' ),