The API for agents
Coding agents can read the whole API in one file, and AI assistants can call it through an MCP server. Both are generated from the same verified OpenAPI as the reference, so they stay in step with it.
Read: llms.txt
/api/llms.txt: what the API does, the basics (hosts, keys, coordinate order, units, errors, attribution) and a link to every operation./api/llms-full.txt: every operation in one file, with its parameters, request and response fields, a working curl request and its errors.
Point a coding agent at https://trailsplits.com/api/llms-full.txt and ask for what you want to build; the quickstart and the TypeScript client help it start.
Call: the MCP server
https://trailsplits.com/api/mcp speaks the Model Context Protocol over Streamable HTTP. It has 17 tools, one per operation, all read-only. Calls need your key, from the API console (free, 30,000 credits a month); they count against your project like any other call. Listing the tools needs no key.
Claude Code
claude mcp add --transport http trailsplits https://trailsplits.com/api/mcp \
--header "Authorization: Bearer $TRAILSPLITS_API_KEY" Other clients (Claude Desktop, Cursor, VS Code…)
Most take a JSON entry like this; where a client cannot send headers, use it through a local MCP proxy that can.
{
"mcpServers": {
"trailsplits": {
"type": "http",
"url": "https://trailsplits.com/api/mcp",
"headers": {
"Authorization": "Bearer ts_live_…"
}
}
}
} By hand
curl -sS https://trailsplits.com/api/mcp -H 'Content-Type: application/json' -H "Authorization: Bearer $TRAILSPLITS_API_KEY" \
--data '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"roundtrips","arguments":{"start":[7.7491,46.0207],"distance_km":8}}}' Answers come back as the API's JSON, with the credits left this month. A static map comes back as an image.
Tools
| Tool | What it does |
|---|---|
elevation | Terrain pixel sampling |
route-analysis | Analyse a route you already have |
roundtrips | Round trips from a start point |
route-weather | Weather along a route at arrival time |
elevation-profile | Elevation profile of a line |
waypoint-route | Route through waypoints |
pace-plan | Pace plan for a course |
gpx-clean | Clean a GPX file |
gpx-simplify | Simplify a GPX file or line |
search | Place search |
reverse | Places near a point |
trails | Trail search |
pois | Outdoor places in an area |
static-map | Static map image |
trace-attributes | Map matching and trace attributes |
snow | Snow along a route |
route | Outdoor point-to-point route |
Map tiles, styles and terrain are not tools: a map client loads them directly (recipe). Weather forecasts are reached through route-weather.