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 27 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.
From two places to a brief and a best day
waypoint-routewithwaypointsas[lon, lat]andprofile: "hike": a route on signed trails, with itsgeometry(a GeoJSON LineString).route-briefwith thatgeometry(add adeparturewith its offset for the weather along it): climb, time, surfaces and grades, water, huts and stops, snow and fires, in one answer.route-windowswith the samegeometry,from_dateanddays: the start times ordered by your preferences, each saying why.
The same geometry goes to route-places, route-exits, route-slopes and route-card. A route brief is a large answer: quote its parts (analysis, places, weather), not all of it.
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 |
route-exits | Exits along a route |
outings | Day outings near a point |
time-model-fit | Your own walking pace (time model) |
route-card | Route card to print |
route-windows | Go windows: which day and start time |
route-slopes | Slope at the path (experimental) |
route-brief | Route brief |
route-places | Places along a route |
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 |
trails-bbox | Trails in an area |
trail-relation | A trail relation’s line |
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.