Inspiration

I am usually short on time for planning my next hike or trail run. I always leave it until the very end. It is hard to Google "ChatGPT" and get routes from AllTrails or Wikiloc. They are unverified, and more than once I have been on closed hikes or dangerous segments. Also, I think we need to be able to co-create with agents.

Planning a hike is not really a question with a single text answer. It is a shared, spatial decision: where to start, whether a route genuinely closes as a loop, how far it is, what the ascent looks like, and what the current planning context is.

I built Switchback around a simple idea: ask for a loop, then see the ground truth. Rather than having an agent recommend a walk somewhere in a random place, a person and an agent work on the same Collserola–Vallvidrera map and can inspect the same route, evidence, and limitations.

What it does

Switchback is a WebMCP-native trail planner for short, car- or public transport-accessible walks around Collserola in Barcelona, Spain. It is the closest national park to the town.

A person can ask for a family loop, a specific distance, or an evening option in natural language. The agent discovers the WebMCP tools, selects from graph-verified circuit options, validates a route before changing the map, and renders the result directly in the shared interface.

The result stays inspectable:

  • A closed circuit is drawn on the map.
  • The route card shows measured distance and sampled ascent.
  • Forecast, daylight, and official Park notices appear as clearly labeled planning context.
  • Every agent action is visible in a shared worklog and trail ledger.
  • The agent can prepare a briefing or GPX trace, but the person remains in control: they review/copy the briefing and manually click Download GPX.

How I built it

Switchback is a static TypeScript app hosted on Netlify. It registers fourteen page-bound WebMCP tools through the browser’s model context, with strict JSON schemas and the same planner functions used by the manual UI.

Routing happens locally in the browser over a 66-tile directed Collserola TrailPack assembled from OpenStreetMap data and the Park’s published public-use network. The planner only offers routes that the available graph can close without a long retraced leg. I have used the official PDF and the park's website.

I added route-aware forecast/daylight context via Open-Meteo and official Park-alert context through a same-origin adapter. Original Catalan notices remain visible; English is clearly labeled as machine translation. I used the AWS Translate service and Amazon Location services for the translations and maps.

Challenges I ran into

The hardest problem was avoiding an impressive-looking but untrustworthy route suggestion. A distance target alone does not prove that a loop closes, and a forecast does not prove that a hike is safe.

That led to a few important product constraints:

  • Routes are graph-validated before they render.
  • Short, Medium, and Long are distance profiles, not difficulty labels.
  • Difficulty is only described conservatively when the available ascent and terrain data support it.
  • Forecasts and Park notices are planning signals, never a safety clearance.
  • The agent cannot auto-download GPX files, send messages, or access external accounts.

What I learned

WebMCP is most compelling when the agent is not treated as a chat layer bolted onto an app Sometimes, it was hard for ChatGPT to use the tools because the agent's skill was not working correctly. I even fixed my local installation of ChatGPT with Codex.

Built With

Share this project:

Updates

Submission history