Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Plot Bar

plot_bar

Draw grouped or stacked bar charts and histograms from CSV or inline JSON, with optional error bars, value labels, and limit lines, and export deterministic SVG, PNG, and plot data JSON.

Instructions

Draw a bar chart (categories x up to 6 series, grouped or stacked, optional error bars and value labels) or a histogram of one column (2..200 bins or explicit edges; counts, density or cumulative) as a deterministic SVG plus plot_data.json with the bin edges and counts (hlines mark limits), and by default plot.png, a 1600 px wide picture (format=both; data.png_path; needs the png extra) that also comes back as an image in the reply (inline_image): hand over the PNG, not the SVG path. Data: a CSV with a header row or inline JSON series.

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": "plot_bar"
  }
}

Input Schema

NameRequiredDescriptionDefault
binsNoHistogram: number of equal bins over the data range, 2..200; 0 = Sturges rule ceil(log2 n)+1.
gridNotrue draws horizontal grid lines at the y ticks; false draws none.
modeNobar (categories and values) or histogram (distribution of one column of numbers).bar
themeNoauto (follows the viewer's light/dark), light, dark, or print (black and grey).auto
titleNoChart title, plain text <= 120 characters, e.g. 'Cycle ranges'; blank = none.
widthNoSVG width in px, 200..2400, e.g. 800.
formatNoPicture file: both (default: plot.svg + plot.png 1600 px wide; PNG needs the png extra), svg (no PNG) or png (no SVG).both
heightNoSVG height in px, 200..2400, e.g. 450.
hlinesNoHorizontal limit lines 'value,label;...' in y units, e.g. '250,yield;-250,'; at most 10; the y axis grows to show them.
legendNoauto (2+ series), off, top_right, top_left, bottom_right, bottom_left or right (outside the plot).auto
seriesNoInline JSON [{"name":"2025","x":["A","B"],"y":[3,5],"err":[0.2,0.4]}]; bar: <=6 series, same x; histogram: one, y used.
x_labelNox axis title with unit, plain text <= 120 characters, e.g. 'Stress range (MPa)'.
y_labelNoy axis title with unit, plain text <= 120 characters, e.g. 'Cycles'.
y_rangeNoFixed y axis 'min,max': plain numbers in the axis unit, no unit text, e.g. '0,50' (not '0,50 kN'); blank = automatic from 0.
stackingNogrouped (bars side by side) or stacked (positives up, negatives down); bar mode with 2+ series.grouped
x_columnNoBar mode, CSV: the category column (text allowed), e.g. 'part'; blank = the first column.
bin_edgesNoHistogram: explicit increasing edges 'e0,e1,...', e.g. '0,50,100,200' (3..201 values); instead of bins.
data_fileNoCSV/TXT path with a header row, e.g. ws/<job>/rainflow_cycles.csv. Give this or 'series'.
histogramNoHistogram heights: counts, density (bars integrate to 1) or cumulative counts.counts
y_columnsNoCSV value columns, e.g. 'q1,q2' (bar, <=6) or one column (histogram); blank = numeric columns / first column.
err_columnsNoBar mode, CSV: error-bar half widths, one column per y column in the same order, e.g. 'q1_err,q2_err'.
inline_imageNotrue (default): the PNG also comes back as an image block in the reply when it is <= 600 kB; false: path only.
value_labelsNotrue writes each bar's value above it (stacked: the total); skipped where a bar is too narrow.

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it declares the output deterministic, names every artifact written to disk (SVG, plot_data.json with bin edges/counts, plot.png), states the PNG's 1600 px width, and flags the 'png extra' dependency plus inline_image delivery. What it omits is whether existing files are overwritten and where the files land relative to data_file paths.

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?

The main action is front-loaded, but the whole definition is a single ~100-word sentence chaining parenthetical parameter asides, which makes it harder to parse than a short structured paragraph would be. Some of the parenthetical detail (format values, png extra, inline_image) duplicates the schema verbatim and could be trimmed.

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?

An output schema exists, so return values need no explanation, and the description still usefully names the artifacts and their roles. For a 23-parameter, zero-required tool with fully documented parameters, the description is complete enough to call correctly, with only file-overwrite/location behavior left unstated.

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 per-parameter baseline is 3; the description goes beyond by tying parameters together — bins 2..200 vs explicit edges, counts/density/cumulative heights, grouped-vs-stacked limited to bar mode with 2+ series, and hlines being reflected in the y axis. It adds cross-parameter meaning rather than restating individual defaults.

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 opens with a specific verb+resource and enumerates the two supported shapes (categories x up to 6 series bar chart, or a one-column histogram) plus the concrete artifacts produced (SVG, plot_data.json, plot.png). An agent can immediately tell this is a chart-generation tool scoped to bar/histogram, not an xy or panel plotter.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: it says what data to supply ('a CSV with a header row or inline JSON series') and gives one actionable directive ('hand over the PNG, not the SVG path'), but never says when to choose plot_bar over plot_xy or plot_panels, nor any preconditions or exclusions.

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

Deploy Server

Other Tools