Existing documentation URL(s)
https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/
What is the issue?
The error-handling example imports two helpers that the agents package does not export,
so it cannot compile:
import { isUnauthorized, isTransportNotImplemented } from "agents";
Checked against agents@0.22.0:
- Neither name appears in any
.d.ts in the published package, under any subpath in
its exports map — not agents, not agents/mcp, not agents/mcp/client.
- Both do exist as functions in one shipped internal chunk
(dist/client-*.js, from src/mcp/client/errors.ts), so they are internal helpers
rather than public API.
I did not guess a replacement, because there does not appear to be a public equivalent —
the closest exported error surface in the package is AgentConnectionError,
isErrorRetryable and isPlatformTransientError, none of which express "the MCP server
returned 401" or "this transport is not implemented".
So this needs someone who knows the intent to decide between:
- exporting the two helpers from the SDK and leaving the docs as they are, or
- rewriting the example against whatever the supported way to detect these two cases is.
Additional information
Found by extracting every import { … } from "…" in the docs' TypeScript blocks and
checking each named import against the published package typings. The same pass turned up
two other broken imports on nearby pages, which are straightforward and are fixed in the
PR linked below:
agents/runtime/execution/schedule-tasks imported getSchedulePrompt and
scheduleSchema from "agents"; they are exported from agents/schedules/parser.
agents/examples/browser-agent imported createBrowserToolHandlers, which does not
exist in the package at all and was unused in the snippet.
Existing documentation URL(s)
https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/
What is the issue?
The error-handling example imports two helpers that the
agentspackage does not export,so it cannot compile:
Checked against
agents@0.22.0:.d.tsin the published package, under any subpath inits
exportsmap — notagents, notagents/mcp, notagents/mcp/client.(
dist/client-*.js, fromsrc/mcp/client/errors.ts), so they are internal helpersrather than public API.
I did not guess a replacement, because there does not appear to be a public equivalent —
the closest exported error surface in the package is
AgentConnectionError,isErrorRetryableandisPlatformTransientError, none of which express "the MCP serverreturned 401" or "this transport is not implemented".
So this needs someone who knows the intent to decide between:
Additional information
Found by extracting every
import { … } from "…"in the docs' TypeScript blocks andchecking each named import against the published package typings. The same pass turned up
two other broken imports on nearby pages, which are straightforward and are fixed in the
PR linked below:
agents/runtime/execution/schedule-tasksimportedgetSchedulePromptandscheduleSchemafrom"agents"; they are exported fromagents/schedules/parser.agents/examples/browser-agentimportedcreateBrowserToolHandlers, which does notexist in the package at all and was unused in the snippet.