getSchema
Retrieve prop schemas for Semiotic chart components to understand required parameters and enable static SVG rendering through renderChart.
Instructions
Return the prop schema for a Semiotic chart component. Pass { component: '' } to get its props, or omit component to list all available components. Components marked [renderable] can be passed to renderChart for static SVG output.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component | No | Component name, e.g. 'LineChart'. Omit to list all. |
Implementation Reference
- ai/mcp-server.ts:55-80 (handler)The handler function `getSchemaHandler` that implements the logic for the "getSchema" tool, including listing available components and returning specific component schemas.
async function getSchemaHandler(args: { component?: string }): Promise<ToolResult> { const component = args.component if (!component) { const all = Object.keys(schemaByComponent).sort() const renderable = new Set(Object.keys(COMPONENT_REGISTRY)) const list = all.map(name => renderable.has(name) ? `${name} [renderable]` : name) return { content: [{ type: "text" as const, text: `Available components (${all.length}):\n${list.join(", ")}\n\nComponents marked [renderable] can be rendered to SVG via renderChart. Others (Realtime*) require a browser environment.\n\nPass { component: '<name>' } to get the prop schema for a specific component.` }], } } const entry = schemaByComponent[component] if (!entry) { const available = Object.keys(schemaByComponent).sort() return { content: [{ type: "text" as const, text: `Unknown component "${component}". Available: ${available.join(", ")}` }], isError: true, } } const renderableNote = COMPONENT_REGISTRY[component] ? "This component can be rendered to SVG via renderChart." : "This component requires a browser environment and cannot be rendered via renderChart." return { content: [{ type: "text" as const, text: `${renderableNote}\n\n${JSON.stringify(entry, null, 2)}` }], } } - ai/mcp-server.ts:403-408 (registration)The registration of the "getSchema" tool within the McpServer instance, defining its description, schema, and handler.
srv.tool( "getSchema", `Return the prop schema for a Semiotic chart component. Pass { component: '<name>' } to get its props, or omit component to list all available components. Components marked [renderable] can be passed to renderChart for static SVG output.`, { component: z.string().optional().describe("Component name, e.g. 'LineChart'. Omit to list all.") }, getSchemaHandler )