Skip to main content
Glama

chart_generate

Create visual charts (bar, line, pie, doughnut, radar) from data to visualize information and insights clearly.

Instructions

Generate a chart image (bar, line, pie, etc.) ($0.002)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
labelsYes
datasetsYes
titleNo

Implementation Reference

  • index.js:50-79 (handler)
    The 'callTool' function serves as the centralized handler for all tool requests, including 'chart_generate', by making authenticated HTTP requests to the IteraTools API.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
  • index.js:44-44 (registration)
    The 'chart_generate' tool is defined and registered within the 'TOOLS' array, specifying its name, schema, API endpoint, and pricing.
    { name: 'chart_generate', description: 'Generate a chart image (bar, line, pie, etc.)', inputSchema: { type: 'object', properties: { type: { type: 'string', enum: ['bar', 'line', 'pie', 'doughnut', 'radar'] }, labels: { type: 'array', items: { type: 'string' } }, datasets: { type: 'array', items: { type: 'object' } }, title: { type: 'string' } }, required: ['type', 'labels', 'datasets'] }, endpoint: '/chart/generate', price: '$0.002' },
Behavior3/5

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

Discloses cost ($0.002) and output format (image), but lacks critical behavioral details since annotations are absent. Missing: return format (URL, base64, file path), synchronous/asynchronous behavior, rate limits, and error handling.

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?

Single sentence with zero waste. Front-loaded with action verb, includes parenthetical examples and pricing without verbosity. Appropriately compact.

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

Completeness2/5

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

Inadequate for the tool's complexity. With 4 parameters (including nested objects), 0% schema coverage, and no output schema, the description must explain data structure requirements and return values. Currently insufficient to guide successful data visualization implementation.

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

Parameters2/5

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

With 0% schema description coverage, the description fails to compensate for the undocumented parameters. Mentions chart types (hinting at 'type' enum) but provides no guidance on the complex 'datasets' array structure or 'labels' format, which are critical for correct invocation.

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?

Clear verb ('Generate') and resource ('chart image') with specific examples (bar, line, pie). Distinguishes from sibling 'image_generate' by specifying chart types, though could explicitly clarify when to use this versus general image generation.

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?

No guidance on when to use this tool versus alternatives like 'image_generate' or 'spreadsheet_generate'. No mention of prerequisites (e.g., data formatting requirements) or when not to use it.

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/fredpsantos33/itera-tools-mcp'

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