Skip to content

render_map_tool: click a place to ask the model about it #284

Open

Description

@mattpodwysocki

Problem

The map is display only. A user who sees a place on it has to type a follow-up ("how do I get to the second one?") instead of acting on it from the map.

Proposal

Clicking a pin, a results row or a basemap POI offers a few actions:

  • Directions here
  • Tell me more
  • What's nearby

Each one sends a follow-up message to the chat through the MCP Apps host API (in ChatGPT, the Apps SDK equivalent). The message carries the place's name and mapbox_id, so the model can call place_details_tool, directions_tool and so on with no guessing.

Notes

  • Host support: check that each host supports sending a message from the page. If it doesn't, fall back to just the popup.
  • Keep it small: a short action list in the popup, not a new panel.
  • Pairs with: reporting the page's state to the model (render_map_tool: tell the model what the user did on the map #287), so a follow-up like "how long is that one?" has context.

Activity

  1. mattpodwysocki commented on Oct 19, 2026

    @mattpodwysocki
    ContributorAuthor

    How to do the "basemap POI" part: feature querying in GL JS.

    • Use Standard featuresets. We're on Standard, so use map.addInteraction with the built-in poi, buildings and place-labels featuresets instead of raw queryRenderedFeatures against layer ids, which change between style versions. A click on any café gives its name, class and coordinates. Check whether the POI carries an id place_details_tool accepts. If it doesn't, fall back to a search by name and coordinates.
    • Hover highlight. Featuresets support feature state, so hovering a POI or building can highlight it. That shows people the map is clickable.
    • Report a problem. The same click can pre-fill a feedback report (feedback_tool: submit map/route feedback via the Feedback API #290).

    Optional extras that use the same mechanism:

    Feature querying only sees what's rendered. For questions about places off screen or not loaded, tilequery (#289) is the server-side option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions