Skip to main content
Glama

Preview chart

preview_chart
Read-only

Draw one chart from the user's data and return it as an image, to check it before you save it to a page with edit_page. One metric from one source; with more, a bars stack, more series lines or the high end of a range. Call list_metrics first for the exact names.

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": {
      "metric": "<metric>",
      "provider": "<provider>",
      "kind": "<kind>"
    },
    "name": "preview_chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoLast day, YYYY-MM-DD.
daysNoDays back from today. Default 30.
kindYesseries: a line over time. bars: one bar per day. figure: the newest value. calendar: a day grid. range: a low to high bar per day. table: one row per metric and one column per day, newest first, each value as stored with its unit (text values too); lab results also show the printed flag and range. A table takes several devices and units in one row: use it for lab results. dots: one row per lab result, the newest reading as a dot on the lab's printed range, older readings as rings, flagged values in the chart colour; set start and end to cover the lab reports.
moreNoseries: up to 3 more lines, any source, same unit (Oura and Garmin HRV). bars: up to 3 more metrics of the same source, stacked (sleep stages). range: one, the high end (metric is the low end). table and dots: up to 59 more rows of the same source, in display order (lab results). With no provider, provider and device are the cell's.
unitNoDraw the values in this unit, only when the user asks for one. Stored values do not change.
colorNoThe chart's colour. Default orange.
labelNoThe name of this line or layer in the legend, in the user's words ("Light", "Deep"). Leave it out for one line. In a table, the row's name in the user's words and language ("LDL cholesterol"); left out, the row shows the name the source printed.
startNoFirst day, YYYY-MM-DD. With end, in place of days.
titleNo
deviceNoOne device of that source, when list_metrics shows several.
metricYesOne metric, as list_metrics names it.
formulaNoOnly when the user asks for their own score or calculation: a formula drawn in place of the metrics. The page keeps the formula; each view computes its values, and freddy stores none of them. a is metric, b to d are more in order (with a formula, more takes any source and unit; one value per day each). Numbers, + - * /, brackets, min(x, y), max(x, y), avg(a, N) = mean of the N days before (N up to 90). Kinds series, bars, figure, calendar; no unit.
providerYesIts source, as list_metrics names it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / formula
      Added value: +{
      +  "description": "Only when the user asks for their own score or calculation: a formula drawn in place of the metrics. The page keeps the formula; each view computes its values, and freddy stores none of them. a is metric, b to d are more in order (with a formula, more takes any source and unit; one value per day each). Numbers, + - * /, brackets, min(x, y), max(x, y), avg(a, N) = mean of the N days before (N up to 90). Kinds series, bars, figure, calendar; no unit.",
      +  "maxLength": 200,
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Changed3 schema fields changed
    • changedInput schema / properties / kind / description
      Previous value: -"series: a line over time. bars: one bar per day. figure: the newest value. calendar: a day grid. range: a low to high bar per day. table: one row per metric and one column per day, newest first, each value as stored with its unit (text values too); lab results also show the printed flag and range. A table takes several devices and units in one row: use it for lab results."New value: +"series: a line over time. bars: one bar per day. figure: the newest value. calendar: a day grid. range: a low to high bar per day. table: one row per metric and one column per day, newest first, each value as stored with its unit (text values too); lab results also show the printed flag and range. A table takes several devices and units in one row: use it for lab results. dots: one row per lab result, the newest reading as a dot on the lab's printed range, older readings as rings, flagged values in the chart colour; set start and end to cover the lab reports."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "series",
      -  "bars",
      -  "figure",
      -  "calendar",
      -  "range",
      -  "table"
      -]New value: +[
      +  "series",
      +  "bars",
      +  "figure",
      +  "calendar",
      +  "range",
      +  "table",
      +  "dots"
      +]
    • changedInput schema / properties / more / description
      Previous value: -"series: up to 3 more lines, any source, same unit (Oura and Garmin HRV). bars: up to 3 more metrics of the same source, stacked (sleep stages). range: one, the high end (metric is the low end). table: up to 59 more rows of the same source, in display order (lab results). With no provider, provider and device are the cell's."New value: +"series: up to 3 more lines, any source, same unit (Oura and Garmin HRV). bars: up to 3 more metrics of the same source, stacked (sleep stages). range: one, the high end (metric is the low end). table and dots: up to 59 more rows of the same source, in display order (lab results). With no provider, provider and device are the cell's."
  4. Changed1 schema field changed
    • addedInput schema / properties / unit
      Added value: +{
      +  "description": "Draw the values in this unit, only when the user asks for one. Stored values do not change.",
      +  "enum": [
      +    "hours",
      +    "kg",
      +    "g",
      +    "mg",
      +    "mcg",
      +    "lb",
      +    "oz",
      +    "m",
      +    "km",
      +    "mi",
      +    "ft",
      +    "cm",
      +    "in",
      +    "kcal",
      +    "kJ",
      +    "m/s",
      +    "km/h",
      +    "mph",
      +    "min/km",
      +    "min/mi",
      +    "mL",
      +    "L",
      +    "fl oz"
      +  ],
      +  "type": "string"
      +}
  5. Changed4 schema fields changed
    • changedInput schema / properties / label / description
      Previous value: -"The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line."New value: +"The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line. In a table, the row's name in the user's words and language (\"LDL cholesterol\"); left out, the row shows the name the source printed."
    • changedInput schema / properties / metric / maxLength
      Previous value: -64New value: +200
    • changedInput schema / properties / more / items / properties / label / description
      Previous value: -"The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line."New value: +"The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line. In a table, the row's name in the user's words and language (\"LDL cholesterol\"); left out, the row shows the name the source printed."
    • changedInput schema / properties / more / items / properties / metric / maxLength
      Previous value: -64New value: +200
  6. Changed2 schema fields changed
    • addedInput schema / properties / label
      Added value: +{
      +  "description": "The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line.",
      +  "maxLength": 40,
      +  "type": "string"
      +}
    • addedInput schema / properties / more / items / properties / label
      Added value: +{
      +  "description": "The name of this line or layer in the legend, in the user's words (\"Light\", \"Deep\"). Leave it out for one line.",
      +  "maxLength": 40,
      +  "type": "string"
      +}
  7. Changed4 schema fields changed
    • changedInput schema / properties / kind / description
      Previous value: -"series: a line over time. bars: one bar per day. figure: the newest value. calendar: a day grid. range: a low to high bar per day."New value: +"series: a line over time. bars: one bar per day. figure: the newest value. calendar: a day grid. range: a low to high bar per day. table: one row per metric and one column per day, newest first, each value as stored with its unit (text values too); lab results also show the printed flag and range. A table takes several devices and units in one row: use it for lab results."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "series",
      -  "bars",
      -  "figure",
      -  "calendar",
      -  "range"
      -]New value: +[
      +  "series",
      +  "bars",
      +  "figure",
      +  "calendar",
      +  "range",
      +  "table"
      +]
    • changedInput schema / properties / more / description
      Previous value: -"series: up to 3 more lines, any source, same unit (Oura and Garmin HRV). bars: up to 3 more metrics of the same source, stacked (sleep stages). range: one, the high end (metric is the low end). With no provider, provider and device are the cell's."New value: +"series: up to 3 more lines, any source, same unit (Oura and Garmin HRV). bars: up to 3 more metrics of the same source, stacked (sleep stages). range: one, the high end (metric is the low end). table: up to 59 more rows of the same source, in display order (lab results). With no provider, provider and device are the cell's."
    • changedInput schema / properties / more / maxItems
      Previous value: -3New value: +59
  8. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare it read-only and non-destructive; the description adds that the result is an image returned for inspection rather than a saved artifact, which implies a non-persisting behavior. It does not discuss failure modes (unknown metric or source) or any limits, but the safety story is consistent and enriched.

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?

Three sentences, front-loaded with the action, output, and intent, with no filler. The middle sentence is telegraphic to the point of being slightly cryptic ('with more, a bars stack, more series lines or the high end of a range'), costing a little clarity for its brevity.

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

Completeness4/5

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

For a 13-parameter tool with no output schema, the description covers the essential framing: what is produced (an image), what it is for (previewing), the naming prerequisite, and the save follow-up. Source/device disambiguation and error handling are left implicit, but the heavy parameter detail is already in the schema.

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 92%, so the schema already carries nearly all parameter meaning, including the long enum explainers for kind and formula. The description's only added parameter insight is a compressed restatement of how the `more` array extends a chart, which largely duplicates the schema's own text. Baseline 3 is appropriate.

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?

The description gives a specific verb and resource ('Draw one chart from the user's data and return it as an image') and states the intent ('check it before you save it to a page with edit_page'). That makes it clearly distinguishable from query_metrics (raw values) and edit_page (persistence) without opening any schema.

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?

It states a prerequisite ('Call list_metrics first for the exact names') and a downstream step (verify before edit_page). It also hints at how extra inputs behave ('with more, a bars stack, more series lines or the high end of a range'). It never says when to use query_metrics instead of a preview, which is the one obvious guidance gap.

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