Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

List Public Tokens

list_public_tokens_tool
Read-onlyIdempotent

Lists Mapbox public (pk.) access tokens for browser web pages and apps, optionally filtered by site URL, so you can embed a URL-restricted token instead of a placeholder or user-pasted token.

Instructions

Lists the Mapbox account's public (pk.) access tokens, for when you build a web page or app outside this chat that loads Mapbox GL JS or calls Mapbox APIs from the browser. Put the returned pk. token in the page: public tokens are made to ship in browser code, so a placeholder or asking the user to paste a token is not needed. To show a map in the chat, use render_map_tool instead; it needs no token. Pass site_url (where the page will run) to get a token restricted to that URL when the account has one. Returns each token's name, whether it is the default, its URL restrictions and scopes, a recommended token, and guidance: for a published site, use a URL-restricted token, and tell the user the default token can be reused by anyone who copies it. Secret tokens are never listed.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_public_tokens_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
site_urlNoWhere the page or app that will use the token is served from, for example "https://example.com" or "http://localhost:3000". Used to pick a public token that is restricted to that URL. Leave it out if you don't know yet.

Output Schema

NameRequiredDescriptionDefault
tokensYes
guidanceYesHow to use the token safely
recommendedNoThe token to use for the given site_url, and why

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.18.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent/openWorld annotations it discloses real behavioral facts: secret tokens are never returned, public tokens are safe to ship in client code, a recommended token is included, and the risk that a default token can be reused by anyone who copies it. It also preempts a common wrong action by saying a placeholder is not needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with purpose and alternative routing, and every sentence carries usable information. It is dense and slightly long for a one-parameter read tool, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single optional parameter with a full output schema, the description covers the decision to call, the alternative, the token safety model, and the shape of the guidance returned. Nothing an agent needs in order to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description adds meaning by explaining that site_url selects a URL-restricted token when the account has one and that omitting it is acceptable when the URL is unknown. It adds operational context rather than just restating the schema, though the exact matching behavior stays implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

It names a specific verb and resource ('Lists the Mapbox account's public (pk.) access tokens') and immediately scopes it to the browser-code use case. It explicitly contrasts with the sibling render_map_tool, so an agent can separate the two without inspecting schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states exactly when to call this tool (building a page or app outside the chat that loads Mapbox GL JS or calls APIs from the browser) and when to use the alternative ('To show a map in the chat, use render_map_tool instead; it needs no token'). It also gives guidance on whether to supply site_url.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.