Debugging
When a call does not go as expected, there are three places to look: what the tool answered, the error log in the dashboard, and the SDK’s debug mode in the browser.
1. Every failure answers with a reason and an id
A tool call that is refused is a normal result, not a hang. Over MCP it is a tool result marked as an error; over REST it is the matching HTTP status. Both carry the same body:
{
"ok": false,
"code": "not_found",
"message": "That element is not on the caller's page right now.",
"next_step": "Call get_page_state again and use an id from the new result.",
"error_id": "err_4f2a9c01b7de"
}next_step is written for the model: most agents recover by following it. error_id identifies this one failure. Over REST it is also in the X-Error-Id response header.
2. The error log
Every failed call from your agents is kept for 30 days under Error log, with the tool, our answer, the integration it came from and the session. Paste an error_id from your voice platform’s own logs to find the call. A session’s own page lists the calls we turned away during it, next to its timeline. We record our answer, never what the agent sent, what was on the page or what the caller typed.
What each code means
| Code | HTTP | Usually means |
|---|---|---|
invalid_request | 400 | The call was missing something or had a value of the wrong kind. The message names the field. Usually the agent's tool definition or prompt needs correcting. |
unauthorized | 401 | The API key was missing, wrong or revoked. |
not_found | 404 | The session or element was not there. Element ids change when the caller's page changes: the agent should call get_page_state again and use an id from the new result. |
forbidden_origin | 403 | The caller's page is on a site that is not in your list of sites, or the agent tried to leave the site. |
invalid_state | 409 | The session was not ready for that: the caller had not joined, their page was loading, sharing was paused, or the session had ended. |
consent_required | 409 | The caller had not allowed it yet. For acting on the page the agent must call request_consent first. |
masked | 409 | The agent tried to use something private: a password, payment field or masked area. |
not_actionable | 409 | That cannot be done: the tool is switched off for your organisation, the element cannot be used that way, or the page refused. |
expired | 410 | The join code or session had expired. |
rate_limited | 429 | Too many calls in a short time for one API key. |
payload_too_large | 413 | The call was too large. |
internal | 500 | This one is on our side. Quote the error id to support; it identifies the failure in our logs. |
3. The SDK’s debug mode
To see what the SDK is doing on a page, switch on debug mode and open the browser’s console. It logs event names, error codes and counts: never labels, values, page text, codes or tokens.
BrowseMCP.mount({
apiUrl: "…",
debug: true,
onError: (error) => console.warn(error.code, error.message),
});localStorage.setItem("browsemcp:debug", "1"); // then reload
localStorage.removeItem("browsemcp:debug"); // to switch it offA healthy session looks like this:
[browsemcp] +0.0s join.start { with: "code" }
[browsemcp] +0.3s join.ok
[browsemcp] +0.5s socket.open { status: "awaiting_consent" }
[browsemcp] +4.1s tree.sent { elements: 42, truncated: false }
[browsemcp] +9.8s command.highlight { request_id: "req_1a2b3c4d" }join.refusedwithforbidden_origin: the page’s site is not under Sites.join.refusedwithexpiredornot_found: the code was mistyped or is older than its time limit.- No
tree.sentafter Allow: the page’s Content Security Policy is probably blocking the connection. Allow the API’s address inconnect-src(see Content Security Policy). command.refused: the page itself refused an action, for example on a private field. The code says why.socket.reconnecting: the network dropped; the SDK tries three times before ending the session.
When the agent says nothing happened
- Open the session under Sessions. The timeline shows each thing the agent did; if a tool is missing from it, the agent never called it, and the fix is in its prompt.
- If the tool is in “Calls we turned away”, the reason is there. The most common is an element id from before the page changed.
- If your voice platform could not connect at all, check the server address and the
Authorizationheader under Connection details.