Skip to main content
Glama

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
NameRequiredDescriptionDefault
componentNoComponent name, e.g. 'LineChart'. Omit to list all.

Implementation Reference

  • 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)}` }],
      }
    }
  • 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
    )
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it returns prop schemas or lists components, and it specifies that components marked [renderable] are usable with 'renderChart'. However, it doesn't mention potential errors, rate limits, or authentication needs, leaving some behavioral aspects uncovered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by usage instructions and a note about sibling tools. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and a key behavioral note about [renderable] components. However, it lacks details on output format or error handling, which could be useful for an agent, though not strictly required given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents the single parameter. The description adds minimal value beyond the schema by reiterating that the component parameter can be omitted to list all, but it doesn't provide additional syntax, format details, or examples beyond what's in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Return the prop schema', 'list all available components') and distinguishes it from siblings by mentioning that components marked [renderable] can be passed to 'renderChart'. It explicitly identifies the resource ('Semiotic chart component') and differentiates between two modes of operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: pass a component name to get its props, or omit it to list all components. It also distinguishes from alternatives by noting that [renderable] components can be used with 'renderChart', clarifying the relationship with a sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/nteract/semiotic'

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