Skip to main content
Glama

render_chart

Read-onlyIdempotent

Draw a Clarifo chart of a result you already fetched. Three outputs:

  • output="python" — ChatGPT and any host with a python / code tool. Returns a ready-to-run matplotlib script with every number, label, colour and the source line embedded server-side. Run it unchanged in your python tool; it ends with plt.show(), which makes the chart appear in your answer. Do not edit the numbers, do not save the figure to a file and never write a Markdown image link (![...](sandbox:...)) — it renders as a broken image.

  • output="image" (default) — a PNG image block, for hosts that show MCP images to the user inline (Claude). ChatGPT does NOT show MCP images to the user: use output="python" there.

  • output="chart_spec" — the validated chart as JSON (periods, one series per metric with its unit, formula and figure basis, per-period citations, quality warnings, a text alternative). For a host that draws charts itself: plot these values exactly and print the warnings; it does not guarantee the host shows an interactive chart.

All three are built from one spec, so they always show the same metrics, periods and figures.

Call it only when a chart earns its place (a trend over 3+ periods, a peer comparison over time, a ranking of 4+ names, a sensitivity grid); a single figure or a two-row comparison needs a sentence or a table. For several metrics of one company pass metrics (e.g. ["revenue", "operating_margin"]: revenue bars on the left axis, the margin as a line on a labelled right axis); a peer comparison takes one metric per call. Only the named metrics are drawn — an unknown metric, or one the result has no values for, is an error, never a substitute. Years with no value for any charted metric are left off the axis; interior gaps stay gaps.

Pass the name of the tool you called and the same arguments you passed it. The data is re-fetched and the chart is computed server-side from Clarifo's stored data — never pass figures yourself, there is no parameter for them. For get_stock_price pass the history-mode arguments (days or a date range); without them that tool performs a live latest-close web lookup.

Chartable tools: compare_companies (multi-year: one line per company for metric, calendar-year aligned; single period: KPI table), forecast_financials, get_company_financials, ownership (all three modes), get_revenue_geography, get_stock_price (history mode, i.e. with days or a date range), get_valuation_history, screen_companies, screen_metric_trend, screen_quality_growers, value_company.

Args: source_tool: Name of the tool whose result to chart. source_args: The arguments you passed to that tool, verbatim. metric: Which metric to chart where the source carries several (compare_companies: revenue (default), operating_margin, net_income, gross_margin, free_cash_flow, ...). get_company_financials: revenue_operating_income draws revenue and operating income in one stacked bar per year (bar total = revenue, base segment = operating income, margin row underneath; a loss hangs below zero). Annual data only. Single-company metrics: revenue, gross_profit, operating_income, ebit, ebitda, net_income, operating_cash_flow, capital_expenditures, free_cash_flow, total_assets, total_equity, eps_diluted (reported) and gross_margin, operating_margin, ebit_margin, ebitda_margin, net_margin, fcf_margin (computed: amount / revenue). output: "python" (ChatGPT / code tools), "image" (PNG) or "chart_spec" (JSON for a host that draws natively). metrics: Several metrics in one chart (get_company_financials); metric alone keeps working. chart_type: "auto" (default: bars for up to 5 annual periods, a line for longer series; an amount with a margin is a bar_line_combo for up to 8 periods), "line", "bar", "grouped_bar", "horizontal_bar" or "bar_line_combo" (one company: amounts as bars, the % metric as a line on its own right axis). Applies to get_company_financials and compare_companies (combo: single company only).

Returns: python: the script plus run instructions and the source line to print under the chart. image: a one-line description plus the PNG. chart_spec: the chart as data. All three carry quality_warnings to print under the chart when present.

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": {
      "source_tool": "<source_tool>"
    },
    "name": "render_chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
metricNo
outputNoimage
metricsNo
chart_typeNoauto
source_argsNo
source_toolYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing that data is re-fetched server-side from stored data, that there is deliberately no parameter for passing figures, and that an unknown or empty metric is an error rather than a silent substitute. Minor gap: it doesn't clarify what happens when source_args don't match the original call or how failures surface, though quality_warnings are mentioned.

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 three outputs and organized under clear headings (outputs, when-to-call, args, returns), so an agent can scan it. However, the output modes are effectively explained twice — once in the bulleted outputs section and again under Args — and the metric list is long enough to add scan cost.

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 six-parameter rendering tool with host-dependent behavior, nothing material is missing: it covers selection criteria, host routing, argument fidelity, error semantics, axis handling for missing years, and even warns against writing Markdown image links. An output schema exists, and the Returns section adds run instructions rather than restating structure.

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

Parameters5/5

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

Schema description coverage is 0%, yet the description documents every parameter thoroughly: source_args must be verbatim the original arguments (with a specific get_stock_price caveat), metric enumerates the valid metric strings including the composite revenue_operating_income, metrics vs. metric interaction, and chart_type lists all six values with auto-selection rules. This fully compensates for the empty 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?

Opens with a specific verb and resource ("Draw a Clarifo chart of a result you already fetched") and immediately distinguishes itself from data-fetch siblings by establishing that it renders rather than retrieves. Enumerating the three output modes up front tells an agent exactly what the tool produces.

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?

Explicitly states when NOT to call it ("a single figure or a two-row comparison needs a sentence or a table") and enumerates the chart-worthy conditions (trend over 3+ periods, ranking of 4+ names, sensitivity grid). It also routes per host: image for Claude, python for ChatGPT/code hosts, and gives the multi-metric vs. peer-comparison calling pattern.

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.