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

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.

Inputs of Pocketlab Slope Converter (degrees, %, 1:n, mm/m)
FieldTypeDefaultDescription
unitselect (deg, percent, ratio, mmPerM, riseRun)"deg"I have the slope in
valuenumber5Value. Degrees, percent, n of 1 : n or mm per metre — as chosen above. Not used for rise and run.
risenumber—Rise. Only for rise and run: height difference.
runnumber—Run. Only for rise and run: horizontal distance, same unit as the rise.
lengthnumber—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)

{
  "mcpServers": {
    "pocketlab-slope-converter": { "type": "http", "url": "https://pocketlabslopeconverter.usefulweb.app/mcp" }
  }
}