API & MCP
Everything a person can do on Tonegrid Scale and Sequence Planner, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://tonegridscaleplanner.usefulweb.site/api/v1/calculate– run Tonegrid Scale and Sequence PlannerGET https://tonegridscaleplanner.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Tonegrid Scale and Sequence Planner
Inspect the pitches in a configurable Tonegrid scale and turn selected cells into a timed note list.
| Field | Type | Default | Description |
|---|---|---|---|
root | number | 48 | Root note (MIDI number). 48 is C3 and 60 is C4. |
scale | select (pentatonic, minorPentatonic, major, minor, dorian, mixolydian, harmonicMinor, blues, chromatic) | "pentatonic" | Musical scale |
bpm | number | 120 | Tempo (BPM) |
swing | number | 0 | Swing (%). Delays alternate steps, like the Tonegrid swing control. |
rows | number | 16 | Melody rows |
steps | number | 16 | Steps |
cells | textarea | "1,16\n5,14\n9,12\n13,11" | Selected cells: step,row. One pair per line, counted from 1. Row 1 is the highest pitch; the last row is the root. Leave blank for just the scale. |
Example request
C major pentatonic melody
curl -X POST https://tonegridscaleplanner.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"root":48,"scale":"pentatonic","bpm":120,"swing":0,"cells":"1,16\n5,14\n9,12\n13,11"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://tonegridscaleplanner.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
tonegrid_scale_planner - Local stdio connector:
node src/mcp-stdio.ts --tool=tonegrid-scale-planner
{
"mcpServers": {
"tonegrid-scale-planner": { "type": "http", "url": "https://tonegridscaleplanner.usefulweb.site/mcp" }
}
}