Tools Reference
Canonical names
Eight canonical names (defined in src/types.ts): health, plot, plot_series, diagram, geometry_3d, teaching, template, analysis. The MCP server exposes 24 unique tool entries in tools/list because the canonical names plus 16 legacy aliases are both registered (legacy names get mapped via src/compat.ts).
How routing works
- Caller invokes tool by name (e.g.
plot_multi) with JSON-RPC arguments handleToolCallinsrc/index.tsL3205 callslookupCompat- Legacy name resolves to canonical name + render format (e.g.
plot_multi->plot+render.format=png) resolveLegacyNamepicks the actual legacy handler based on canonical name and render format- Handler in
_legacyToolHandler(L3100) dispatches tobuildSvgLinkData,pngLinkPayload, orbuildTeachingTemplate
Tool categories (24 tools)
| Category | Tools | Source |
|---|---|---|
| Health | health | src/index.ts L342, L709 |
| Function plot (single) | plot, plot_json, plot_png_link | src/index.ts L347-372 |
| Function plot (multi) | plot_multi, plot_multi_json, plot_multi_png_link | src/index.ts L374-399 |
| Subplot grid | multi_plot (rows/cols with per-cell series) | src/index.ts L401-432 |
| Custom series | plot_series, plot_series_json, plot_series_png_link | src/index.ts L434-458 |
| Bar chart | plot_bar_json (categories+values shortcut) | src/index.ts L578-585 |
| Force diagram | force_diagram_link (simple), force_analysis_link (rich, axes/components/resultant) | src/index.ts L461-486 |
| Force template | force_analysis_template_link (incline/hanging/pulley/double_block/spring/spring_oscillator/pulley_group/horizontal) | src/index.ts L507-528, L902-1173 |
| Circuit | circuit_diagram_link (freeform components+wires+stages), circuit_template_link (10 templates: series/parallel/switch_lamp/source_resistor/led_resistor/meter_loop/transistor_switch/relay_driver/buzzer_loop/opamp_follower) | src/index.ts L488-545 |
| Venn | venn_diagram_link (2 or 3 sets with region labels) | src/index.ts L548-559 |
| C memory | c_memory_diagram_link (blocks for pointer/struct/array) | src/index.ts L561-572 |
| 3D shape | shape3d_link (cube/sphere/cylinder/cone/vector3d, plus scatter3d/line3d/surface3d) | src/index.ts L574-576, L655-664 |
| Teaching | teaching_template_link (single topic), teaching_sequence_link (multi-step sequence) | src/index.ts L587-604 |
| Multi-image batch | plot_multi_images (batch of up to 8 plot jobs) | src/index.ts L3174-3190 |
| Analysis | analysis (describe/corr/groupby) — Phase 1 placeholder | src/index.ts L3208, L695-706 |
Teaching topics (15)
From teachingToolProperties in src/index.ts L86-92:
parabola, definite_integral, tangent_derivative, fourier_series,
projectile_motion, simple_harmonic_motion, energy_conservation,
rc_charging, rlc_transient, incline_force, stress_strain, band_gap,
venn_probability, c_pointer_array, c_struct_layout
Each topic renders a single annotated plot (teaching_template_link) or a 2-3 step sequence (teaching_sequence_link). The sequences are hard-coded in buildTeachingSequence in src/index.ts L2830 — they stitch together multiple buildTeachingPlotPayload / sanitizeForceTemplatePayload calls with short URLs.
Render formats
From src/types.ts L9, RenderFormat = "png" | "svg" | "json" | "link" | "html". Behavior depends on tool:
- png — returns hosted URL (e.g.
https://.../png?d=...), PNG bytes served at URL - svg — inline SVG in the
structuredContentfield - json — full
specJSON + computed payload - link — short link via
/s/{token}(8-char token in KV, 30-day TTL) - html — interactive 3D viewer (only for
shape3d_link)
Annotations
From src/plot.ts L7-11, four kinds: vertical_line, point, label, area. All take a color; area additionally takes opacity. Used by plot_json and plot_series_json families.
Series transforms
From src/plot.ts L76-186, the transforms array on a series applies these operations in order:
| Transform | Effect | Notes |
|---|---|---|
normalize | minmax / zscore / maxabs | Not for hist/box/pie, or series with error bars |
smooth / rolling_average | Centered moving average | Line series only; window default 3 |
filter | Keep points where target op value | ops: >, >=, <, <=, == |
downsample | Uniform / LTTB subsampling | For huge series |
Each emits warnings when skipped (e.g. smooth on scatter). Set args.debug = true to receive a debug object with per-stage traces.