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

  1. Caller invokes tool by name (e.g. plot_multi) with JSON-RPC arguments
  2. handleToolCall in src/index.ts L3205 calls lookupCompat
  3. Legacy name resolves to canonical name + render format (e.g. plot_multi -> plot + render.format=png)
  4. resolveLegacyName picks the actual legacy handler based on canonical name and render format
  5. Handler in _legacyToolHandler (L3100) dispatches to buildSvgLinkData, pngLinkPayload, or buildTeachingTemplate

Tool categories (24 tools)

CategoryToolsSource
Healthhealthsrc/index.ts L342, L709
Function plot (single)plot, plot_json, plot_png_linksrc/index.ts L347-372
Function plot (multi)plot_multi, plot_multi_json, plot_multi_png_linksrc/index.ts L374-399
Subplot gridmulti_plot (rows/cols with per-cell series)src/index.ts L401-432
Custom seriesplot_series, plot_series_json, plot_series_png_linksrc/index.ts L434-458
Bar chartplot_bar_json (categories+values shortcut)src/index.ts L578-585
Force diagramforce_diagram_link (simple), force_analysis_link (rich, axes/components/resultant)src/index.ts L461-486
Force templateforce_analysis_template_link (incline/hanging/pulley/double_block/spring/spring_oscillator/pulley_group/horizontal)src/index.ts L507-528, L902-1173
Circuitcircuit_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
Vennvenn_diagram_link (2 or 3 sets with region labels)src/index.ts L548-559
C memoryc_memory_diagram_link (blocks for pointer/struct/array)src/index.ts L561-572
3D shapeshape3d_link (cube/sphere/cylinder/cone/vector3d, plus scatter3d/line3d/surface3d)src/index.ts L574-576, L655-664
Teachingteaching_template_link (single topic), teaching_sequence_link (multi-step sequence)src/index.ts L587-604
Multi-image batchplot_multi_images (batch of up to 8 plot jobs)src/index.ts L3174-3190
Analysisanalysis (describe/corr/groupby) — Phase 1 placeholdersrc/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 structuredContent field
  • json — full spec JSON + 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:

TransformEffectNotes
normalizeminmax / zscore / maxabsNot for hist/box/pie, or series with error bars
smooth / rolling_averageCentered moving averageLine series only; window default 3
filterKeep points where target op valueops: >, >=, <, <=, ==
downsampleUniform / LTTB subsamplingFor 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.