Skip to main content
Glama

generate_treemap_chart

Create a treemap chart to visualize hierarchical data and compare items at the same level. Ideal for tasks like displaying disk space usage or other structured datasets.

Instructions

Generate a treemap chart to display hierarchical data and can intuitively show comparisons between items at the same level, such as, show disk space usage with treemap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesData for treemap chart, such as, [{ name: 'Design', value: 70, children: [{ name: 'Tech', value: 20 }] }].
heightNoSet the height of the chart, default is 600px.
outputTypeNoThe output type of the diagram. Can be 'png', 'svg' or 'option'. Default is 'png', 'png' will return the rendered PNG image, 'svg' will return the rendered SVG string, and 'option' will return the valid ECharts option.png
themeNoSet the theme for the chart, optional, default is 'default'.default
titleNoSet the title of the chart.
widthNoSet the width of the chart, default is 800px.

Implementation Reference

  • generateTreemapChartTool is included in the main exported tools array, which is used to register all chart generation tools with the MCP server.
    export const tools = [
      generateEChartsTool,
      generateLineChartTool,
      generateBarChartTool,
      generatePieChartTool,
      generateRadarChartTool,
      generateScatterChartTool,
      generateSankeyChartTool,
      generateFunnelChartTool,
      generateGaugeChartTool,
      generateTreemapChartTool,
      generateSunburstChartTool,
      generateHeatmapChartTool,
      generateCandlestickChartTool,
      generateBoxplotChartTool,
      generateGraphChartTool,
      generateParallelChartTool,
      generateTreeChartTool,
    ];
  • src/index.ts:22-35 (registration)
    The createEChartsServer function registers all tools from the imported 'tools' array (including generateTreemapChartTool) to the MCP server using server.tool().
    function createEChartsServer(): McpServer {
      const server = new McpServer({
        name: "mcp-echarts",
        version: "0.1.0",
      });
    
      for (const tool of tools) {
        const { name, description, inputSchema, run } = tool;
        // biome-ignore lint/suspicious/noExplicitAny: <explanation>
        server.tool(name, description, inputSchema.shape, run as any);
      }
    
      return server;
    }
  • Imports the generateTreemapChartTool from './treemap' for inclusion in the tools array.
    import { generateTreemapChartTool } from "./treemap";
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description mentions what the tool does but lacks critical behavioral details: it doesn't specify output format (though implied by parameters), error handling, performance characteristics, or any side effects. For a chart generation tool with no annotations, this leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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

Conciseness4/5

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

The description is appropriately concise with two sentences. The first sentence states the core purpose, and the second provides a concrete example. There's no unnecessary verbosity, and the information is front-loaded. However, the example could be more tightly integrated, and the structure could better highlight key differentiators.

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

Completeness3/5

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

Given the complexity (6 parameters, hierarchical data structure) and lack of annotations/output schema, the description is minimally adequate but incomplete. It covers the basic purpose and provides an example, but doesn't address important contextual aspects like output handling (the tool presumably generates visualizations but this isn't explicitly stated), error conditions, or how it differs from similar chart tools. The 100% schema coverage helps, but the description itself doesn't provide enough standalone guidance.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema: it provides an example data structure in the description text ('such as, show disk space usage with treemap'), but this is redundant with the schema's data parameter description. No additional parameter semantics or usage context are provided beyond what's in the structured schema.

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

Purpose4/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: 'Generate a treemap chart to display hierarchical data and can intuitively show comparisons between items at the same level.' It specifies the verb ('generate'), resource ('treemap chart'), and functional intent ('display hierarchical data...show comparisons'). However, it doesn't explicitly differentiate from sibling tools like 'generate_tree_chart' or 'generate_sunburst_chart' which also handle hierarchical data, missing full sibling differentiation.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance. It includes an example use case ('such as, show disk space usage with treemap'), which implies this tool is suitable for hierarchical data visualization tasks. However, it offers no explicit guidance on when to use this tool versus alternatives (e.g., 'generate_tree_chart' or 'generate_sunburst_chart' from the sibling list), no mention of prerequisites, and no clear 'when-not-to-use' scenarios.

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

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/hustcc/mcp-echarts'

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