Skip to main content

Triage Errors from an Agent

Source reviewed: 2026-12-02 against custdctl errors, the Admin API tenant MCP endpoint and a Claude Code sign-in.

An agent such as Claude Code or Codex can read your error issues and mark them resolved once a fix ships. It acts as you: the API applies your own roles and tenant scope, exactly as in Errors (/errors). Capturing errors is covered in Track errors.

Use custdctl from the agent​

This works from any agent that can run a shell command. Install the client and sign in once, as described in Use the custdctl client:

custdctl login --profile prod
custdctl account --profile prod

Then the triage loop is four commands:

# 1. Find the Site whose errors you want, by name, and copy its UUID.
custdctl sites list --profile prod

# 2. List its open issues, most frequent first.
custdctl errors list --profile prod --site SITE_UUID --state open --sort frequent

# 3. Read one issue: exception, code locations, release and latest occurrence.
custdctl errors show --profile prod ISSUE_UUID

# 4. After the fix is deployed, resolve it. A return in a later release reopens it as a regression.
custdctl errors resolve --profile prod ISSUE_UUID

Add --json for machine-readable output. errors list pages with --limit and --cursor; errors ignore and errors reopen change state the same way as resolve. Ignore an issue only as a deliberate decision, not to clear a list.

If errors show includes a correlation_id, use it to find the matching event in the reporting application's logs. The CLI's request_id identifies the API request that fetched the issue.

In the Errors page, the stack trace identifies known browser capture paths, including unhandled promise rejections and React error handlers. An error can identify its capture path even when its browser supplied no stack frames.

Use the tenant MCP endpoint​

The same operations are MCP tools on the Admin API. An MCP host such as Claude Code signs in by itself with your normal Custd sign-in:

claude mcp add --transport http custd https://custd.com/mcp/tenant
claude mcp login custd

The login command (or /mcp inside a Claude Code session) opens the Custd sign-in page. The host identifies itself with its public client metadata document, so there is no client to create and no secret to copy.

For Codex, use codex mcp add custd --url https://custd.com/mcp/tenant and codex mcp login custd.

As of 2026-12-02, both hosts need a Custd update that is not yet deployed: the sign-in server refuses Claude Code's localhost callback, and the endpoint does not yet speak the older MCP revision (2025-06-18) Codex 0.173 opens with, so Codex lists no tools. Until it is deployed, use custdctl from either agent.

The first time an application signs in for your company, the sign-in page says Approval needed. A tenant administrator opens Admin → External Apps, selects Review request and approves it. This is asked once per company. Then run claude mcp login custd again. Approval never gives the application more than the signed-in person's own access.

SettingValue
URLhttps://custd.com/mcp/tenant
TransportStreamable HTTP, MCP revision 2026-07-28
AuthorizationOAuth 2.1 with PKCE and client metadata documents, discovered from the endpoint's 401

Hosts that can only register with dynamic client registration cannot sign in yet; use custdctl from those agents.

ToolArgumentsUse
sites-listnoneFind the Site UUID by name. Needs Site administration access.
error-issues-listsiteUuid, state (open, resolved, ignored or all), sort (recent or frequent), limit, cursorOne page of issues.
error-issues-getissueUuidOne issue and its latest occurrence.
error-issues-set-stateissueUuid, state (open, resolved or ignored)Audited state change. Needs error issue write access.

A worked call sequence: sites-list, then error-issues-list {"siteUuid": "SITE_UUID", "state": "open", "sort": "frequent"}, then error-issues-get {"issueUuid": "ISSUE_UUID"}, and after the fix ships error-issues-set-state {"issueUuid": "ISSUE_UUID", "state": "resolved"}.

The endpoint serves the company you chose at sign-in. A platform credential used directly as a bearer token (not through a host sign-in) may instead name one company with the X-Custd-Effective-Company header: the same support-access check as the Admin API applies to every tool call (a person needs an active support grant for that company) and each call is recorded in that company's audit log. Tools served by services other than the Admin API, and the Messages archive, refuse that header.

Recovery​

A 401 means the sign-in expired: run custdctl login --profile prod, or claude mcp login custd, again. A 403 means your account lacks the permission or the issue belongs to another tenant; ask your tenant administrator rather than switching accounts. Never paste tokens into the agent's prompt, a repository file or a ticket.