API & MCP
Everything a person can do on Pocketlab Slope Converter (degrees, %, 1:n, mm/m), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://pocketlabslopeconverter.usefulweb.app/api/v1/calculate– run Pocketlab Slope Converter (degrees, %, 1:n, mm/m)GET https://pocketlabslopeconverter.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Pocketlab Slope Converter (degrees, %, 1:n, mm/m)
Converts a slope or tilt between the units builders, cyclists and DIYers use: degrees, percent grade, a 1 : n ratio, millimetres of rise per metre, or rise over run. Give a length to get the height difference over it and the length along the slope. The Pocketlab spirit level shows its readings in the same units.
| Field | Type | Default | Description |
|---|---|---|---|
unit | select (deg, percent, ratio, mmPerM, riseRun) | "deg" | I have the slope in |
value | number | 5 | Value. Degrees, percent, n of 1 : n or mm per metre — as chosen above. Not used for rise and run. |
rise | number | — | Rise. Only for rise and run: height difference. |
run | number | — | Run. Only for rise and run: horizontal distance, same unit as the rise. |
length | number | — | Horizontal length (optional). Any unit; the height difference over it comes out in the same unit. |
Example request
Wheelchair ramp 1 : 12 over 3.6 m
curl -X POST https://pocketlabslopeconverter.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"unit":"ratio","value":12,"length":3.6}'
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://pocketlabslopeconverter.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
pocketlab_slope_converter - Local stdio connector:
node src/mcp-stdio.ts --tool=pocketlab-slope-converter
{
"mcpServers": {
"pocketlab-slope-converter": { "type": "http", "url": "https://pocketlabslopeconverter.usefulweb.app/mcp" }
}
}