export_collection
Export collections from Outline wiki in Outline Markdown or JSON format 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 core handler function implementing the export_collection tool logic. It makes an API call to '/collections.export' with the collection ID and format, returning success status and 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 defining the input for export_collection: requires collectionId (UUID) and format (enum: 'outline-markdown' or 'json').export const exportCollectionSchema = z.object({ collectionId, format: exportFormat });
- src/lib/tools.ts:161-165 (registration)Registers the export_collection tool in the allTools array using createTool, linking to its schema and description for MCP tool discovery.createTool( 'export_collection', 'Export a collection.', 'export_collection' ),
- src/lib/schemas.ts:193-193 (schema)TypeScript type inferred from the exportCollectionSchema for type-safe input handling in the handler.export type ExportCollectionInput = z.infer<typeof exportCollectionSchema>;
- src/lib/schemas.ts:236-236 (registration)Maps the export_collection tool name to its schema in the central toolSchemas object used by tool definitions.export_collection: exportCollectionSchema,