Skip to main content
Glama

exportWhiteboard

Export Heptabase whiteboards to markdown, JSON, or HTML formats with options to include cards, connections, and metadata for enhanced data organization and sharing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNomarkdown
includeCardsNo
includeConnectionsNo
includeMetadataNo
outputPathYes
whiteboardIdYes

Implementation Reference

  • Main handler function that fetches whiteboard data, generates export content in markdown, json, or html format, writes it to the specified output path, and returns a success message.
    export async function exportWhiteboard( dataService: HeptabaseDataService, params: z.infer<typeof exportWhiteboardSchema> ) { const data = await dataService.getWhiteboard(params.whiteboardId, { includeCards: params.includeCards, includeConnections: params.includeConnections }); let content = ''; switch (params.format) { case 'markdown': content = await generateMarkdownExport(data, params); break; case 'json': content = JSON.stringify(data, null, 2); break; case 'html': content = await generateHtmlExport(data, params); break; } await fs.mkdir(path.dirname(params.outputPath), { recursive: true }); await fs.writeFile(params.outputPath, content, 'utf8'); const response = [`Exported whiteboard to ${params.outputPath}`]; if (params.includeMetadata) { response.push('Included metadata in export'); } return { content: [{ type: 'text', text: response.join('\n') }] }; }
  • Zod schema defining the input parameters for the exportWhiteboard tool, including whiteboard ID, export format, inclusion flags, and output path.
    export const exportWhiteboardSchema = z.object({ whiteboardId: z.string(), format: z.enum(['markdown', 'json', 'html']).optional().default('markdown'), includeCards: z.boolean().optional().default(true), includeConnections: z.boolean().optional().default(false), includeMetadata: z.boolean().optional().default(false), outputPath: z.string() });
  • src/server.ts:668-681 (registration)
    Tool registration in the MCP server: imports the handler and schema from export.ts, wraps the handler to ensure data service initialization, and registers it with this.server.tool.
    const { exportWhiteboard, summarizeWhiteboard, exportWhiteboardSchema, summarizeWhiteboardSchema } = require('./tools/export'); // exportWhiteboard tool this.tools.exportWhiteboard = { inputSchema: exportWhiteboardSchema, handler: async (params) => { await this.ensureDataServiceInitialized(); return exportWhiteboard(this.dataService, params); } }; this.server.tool('exportWhiteboard', exportWhiteboardSchema.shape, async (params: z.infer<typeof exportWhiteboardSchema>) => { return this.tools.exportWhiteboard.handler(params); });

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LarryStanley/heptabse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server