Skip to content

formatMcpConnectFailureMessage

formatMcpConnectFailureMessage(serverName, error, options?): string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/utils/mcpAuthError.ts:77

Build the user-facing message for a failed MCP integration. For auth failures it names the integration, states the credential is expired/invalid, and points at the concrete fix path (OAuth login or the API token / authorization header, plus the mcpServers entry in gth config). For other failures it surfaces the failure plainly and explicitly says it is NOT an auth error, so an unrelated transient never triggers a spurious “re-authenticate” nudge.

Either way the caller degrades gracefully AFTER surfacing this — the integration’s tools are dropped for the session, but the user (and the log) now knows why.

string | undefined

unknown

McpConnectFailureOptions = {}

string