Skip to main content
Glama

visualize

Read-only

Fetch data and render it: a Vega-Lite chart when vega_lite is given, else an inline data grid. Use it instead of run_sql whenever the user asks for a chart, plot or graph of Mycorr data, or to see a Mycorr table's rows.

Pass exactly ONE source: table_id to show one RAW table, or sql for a query. To show a table's rows, pass table_id and NO sql: the view follows the CURRENT schema, so renames, new columns and edits show on refresh; a SELECT freezes it.

The SQL is DataFusion SQL under run_sql's rules (ids not names, double quotes, read-only). Alias every selected column to a readable name (SELECT "col-…" AS region, SUM("col-…") AS revenue … GROUP BY region); raw col-… labels are refused.

CHARTS: a Vega-Lite v6 unit or layer spec; there are no named chart types. Fields are your SELECT aliases; omit encoding types (the server fills them and lists each in spec_inferences). A bar chart: {"mark": "bar", "encoding": {"x": {"field": "region", "sort": null}, "y": {"field": "revenue"}}}; swap the mark for line/area/point/rect, add color for series, layer for overlays. Order categories with an outer ORDER BY in SQL. Aggregate to tens of marks. There are 8 series colours: fold a long tail into 'Other' in SQL (chart_hints warns past 8).

Relay truncated, join_fan_out and unlinked_joins warnings to the user.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "visualize"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoOne read-only SQL statement, as for `run_sql`. Give exactly ONE of `sql` / `table_id`.
titleNoTitle shown above the chart or grid.
max_rowsNoMaximum result rows: default 1000, cap 10000. Aggregate in SQL rather than raising it.
table_idNoShow this table as it is now, rebuilt from the CURRENT schema on every refresh; `_row_id` comes along. Pass NO `sql` with it.
vega_liteNoVega-Lite v6 unit or layer spec (JSON object, ≤32KB). `facet`/`repeat`/`concat` are refused: use the `row`/`column` channels. Omit it for a plain data grid. Omit `data`: the result is injected as the only dataset, and `url`, `href` and nested `data`/`datasets` are refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, it discloses non-obvious behavior: a `table_id` view is rebuilt from the CURRENT schema on every refresh while a SELECT freezes it, raw `col-…` labels are refused, encoding types are inferred and listed in `spec_inferences`, and `chart_hints` warns past 8 series colours. It also tells the agent which result warnings (`truncated`, `join_fan_out`, `unlinked_joins`) must be relayed. It stops short of describing failure modes for invalid specs or the shape of the rendered output, but the added context is substantial.

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?

Front-loaded with the one-line purpose before the source-selection rule, then grouped under a CHARTS heading, which makes it scannable. It is dense but nearly every clause carries a constraint an agent would otherwise get wrong; the inline JSON example is justified, though the chart paragraph runs long.

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

Completeness5/5

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

For a 5-param, zero-required tool with a nested free-form Vega-Lite object and no output schema, the description covers source exclusivity, SQL dialect constraints, spec restrictions (no facet/repeat/concat, no data/url/href), and the warnings to surface. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds real meaning on top — the required column-aliasing convention, omission of encoding `type`s, the mutually exclusive source rule, and the instruction to aggregate in SQL rather than raise `max_rows`. It does not restate `title` or `max_rows` defaults, but those are already fully documented in schema.

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?

States a concrete verb and dual output mode: 'Fetch data and render it: a Vega-Lite chart when `vega_lite` is given, else an inline data grid.' It also names the sibling it replaces for rendering ('instead of `run_sql`'), so an agent can distinguish it from the raw query tool immediately.

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?

Gives explicit when-to-use triggers ('whenever the user asks for a chart, plot or graph of Mycorr data, or to see a Mycorr table's rows') and explicit routing against the alternative `run_sql`. It also states the exclusivity rule up front: 'Pass exactly ONE source', with per-case guidance for `table_id` vs `sql`.

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.

Resources