Skip to main content
Glama

Chart

chart
Read-onlyIdempotent

Draw a chart from a query on a dataset: the query runs like aggregate (or query_rows when it has select), then result columns map onto the chart. x is the group_by column for the axis or categories; y lists metric names (or columns); series splits line, area, columns and bar into one series per value. grain (day, week, month, quarter, year) groups a date column in group_by by that period. mode draws columns and bars stacked, grouped or as 100%. variance, bullet and scorecard take two y columns (actual, then plan or target); candlestick takes four (open, high, low, close). Measures defined as lower is better (costs) are coloured the right way round. Write the title as the takeaway ("Asia Pacific grew fastest in 2026"), not a label, and the subtitle as the measure and unit. Returns the SVG and the chart spec. Charts: line, area, columns, bar, donut, treemap, waffle, funnel, pareto, scatter, heatmap, histogram, kpi, table, variance, bullet, waterfall, scorecard, combo, radar, candlestick, gauge, box, dotPlot.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "dataset_id": "<dataset_id>",
      "chart": "<chart>"
    },
    "name": "chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
pieNo
modeNo
chartYes
grainNoGroup date and timestamp columns in group_by by this period (week starts Monday); each group is labelled with the period's first day
limitNo
themeNoLeave out for the workspace's brand (or datatomcp light when it has none)
titleNo
whereNo
wordsNoReplace words the chart draws by itself, e.g. { "plan": "Budget" }
formatNo
invertNoLower is better for the values drawn (costs, churn)
selectNo
seriesNo
metricsNo
versionNoThe dataset version from an earlier result's meta (or one listed in describe_dataset's versions). Pass it when you chain calls (distinct_values, then aggregate): the answer stays on that version even if the data was refreshed in between (meta then has stale: true and current_version). If that version is no longer kept, the call fails with source_changed.
currencyNo
group_byNo
order_byNo
subtitleNo
highlightNo
dataset_idYesDataset id from list_datasets, e.g. ds_ab12cd34ef56

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / metrics / items / properties / where / items / properties / op / description
      Previous value: -"between takes [low, high] and includes both ends; in/not_in take an array; contains/starts_with are case-insensitive text matches"New value: +"between takes [low, high] and includes both ends; in/not_in take an array; contains/starts_with are case-insensitive text matches; on date and timestamp columns a value can be relative to the time of the query: now, now-30d, now-12w, now-3m, now-1y"
    • changedInput schema / properties / where / items / properties / op / description
      Previous value: -"between takes [low, high] and includes both ends; in/not_in take an array; contains/starts_with are case-insensitive text matches"New value: +"between takes [low, high] and includes both ends; in/not_in take an array; contains/starts_with are case-insensitive text matches; on date and timestamp columns a value can be relative to the time of the query: now, now-30d, now-12w, now-3m, now-1y"
  2. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the bar is lower, and the description adds real context: it returns the SVG and chart spec, explains grain labelling, and that invert-driven measures are coloured 'the right way round'. It says nothing about limits, truncation at limit/maxItems, or error behaviour on invalid chart/param combinations.

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

Conciseness3/5

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

Front-loaded and dense, but the closing 'Charts: line, area, …' list restates the chart enum verbatim from the schema, earning nothing. The title/subtitle style advice is useful but sits mid-paragraph inside an already parenthesis-heavy run-on.

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?

For a 23-parameter tool with no output schema, the description covers the chart-mapping core and the return value, which is the most important part. It is still silent on roughly ten parameters and on how limit interacts with drawn categories, so an agent calling it fully would be guessing on several fields.

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 coverage is only 26% across 23 parameters, so the description must carry the load. It does explain the semantically central ones well (x as group_by column, y as metrics/columns, series for splitting line/area/columns/bar, grain for date bucketing, mode, and the multi-y requirements of variance/bullet/scorecard/candlestick), but leaves pie, theme, limit, where, words, format, highlight, order_by, currency and version undocumented in prose.

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?

Opens with a specific verb and resource: 'Draw a chart from a query on a dataset', then immediately explains the query model (aggregate, or query_rows when select is present). An agent can distinguish this from aggregate/query_rows because the output is a rendered chart plus spec, not rows.

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

Usage Guidelines4/5

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

Routes the agent usefully: the query behaves like aggregate, or like query_rows when select is used, and it states which chart types require two or four y columns. It lacks an explicit 'use chart instead of aggregate when you need a visualization' statement and any when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.