List Public Tokens
list_public_tokens_toolLists 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
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | No | Where 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
| Name | Required | Description | Default |
|---|---|---|---|
| tokens | Yes | ||
| guidance | Yes | How to use the token safely | |
| recommended | No | The token to use for the given site_url, and why |