export_object
Export Anytype objects to Markdown format for external use or backup. Extract content to share with other applications or create portable documentation files.
Instructions
Exports an Anytype object in Markdown format. This tool allows you to extract content from Anytype for use in other applications or for backup purposes. Markdown format is human-readable and suitable for documentation. Use this tool when you need to share Anytype content with external systems or create portable backups.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | Space ID containing the object | |
| object_id | Yes | Object ID to export | |
| format | Yes | Export format (currently only 'markdown' is supported) |
Implementation Reference
- src/index.ts:316-333 (handler)The handler function that executes the tool logic: makes a GET request to the Anytype API to export the specified object in markdown format and returns the JSON response or error.async ({ space_id, object_id, format }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/objects/${object_id}/${format}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } }
- src/index.ts:309-315 (schema)Zod input schema defining required parameters: space_id, object_id, and format (fixed to 'markdown').{ space_id: z.string().describe("Space ID containing the object"), object_id: z.string().describe("Object ID to export"), format: z .literal("markdown") .describe("Export format (currently only 'markdown' is supported)"), },
- src/index.ts:306-334 (registration)Tool registration call using McpServer.tool() method, specifying name, description, schema, and handler.this.server.tool( "export_object", "Exports an Anytype object in Markdown format. This tool allows you to extract content from Anytype for use in other applications or for backup purposes. Markdown format is human-readable and suitable for documentation. Use this tool when you need to share Anytype content with external systems or create portable backups.", { space_id: z.string().describe("Space ID containing the object"), object_id: z.string().describe("Object ID to export"), format: z .literal("markdown") .describe("Export format (currently only 'markdown' is supported)"), }, async ({ space_id, object_id, format }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/objects/${object_id}/${format}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } } );