Agent SDK reference - TypeScript changedagent-sdk/typescript
Upstream edited this page at 25 Oct 2026 15:38 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 25 Oct 2026 16:07 UTC.
Upstream edited
Recorded here
Lines+5added
Lines−1removed
From line
1,826
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits121to this page, all time
The whole hunk
from line 1826, old and new numbered
/
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 1826
18261826* Turns that answer no message of yours, or answer a message you sent without a `uuid`
18271827* Results that answer no message you sent, such as the zeroed result after a crashed worker process
18281828
1829When a [`UserPromptSubmit`](https://code.claude.com/docs/en/hooks#userpromptsubmit) hook blocks a message that starts its own turn, or stops it with `continue: false`, you still get a result for that message. It's a success result with `is_error: false` and `num_turns: 0`, its `result` is the [block message](https://code.claude.com/docs/en/hooks.md#what-a-blocked-prompt-leaves-behind) or [stop message](https://code.claude.com/docs/en/hooks.md#json-output), and it echoes the message's `uuid` under the same rules as any other result. The result has no `terminal_reason`, and nothing on it besides the `result` text says a hook ended the turn. A message that a hook blocks while another turn is running may get no result: see [`user_message_uuids`](#user_message_uuids).
1830
18291831#### `user_message_uuids`
18301832
18311833The `uuid`s of every message you sent that Claude Code answered in this turn. When you send several messages close together, Claude Code can merge them into one turn, and `user_message_uuid` then names only the last of them. To match the reply to any of the merged messages, look for that message's `uuid` anywhere in this list. Requires Agent SDK v0.3.259 or later.
from line 1834
18321834
18331835Claude Code sets the list together with `user_message_uuid` on each reply frame that carries that field and on the result. For the full set of turn frames that echo the answered message's `uuid`, and the version each requires, see [`user_message_uuid`](#user_message_uuid). The list always contains `user_message_uuid` and holds at most 64 entries.
18341836
1835When Claude Code picks up a regular message you sent while a turn was running, it adds that message's `uuid` to the result's list.
1837When Claude Code picks up a regular message you sent while a turn was running, it adds that message's `uuid` to the result's list. When a [`UserPromptSubmit`](https://code.claude.com/docs/en/hooks#userpromptsubmit) hook blocks the message at pickup, Claude Code drops it instead: the message never reaches Claude and isn't kept for a later turn. You get no result for it, and its `uuid` appears in no result's list. If a hook can block messages, set a timeout on waiting for a result that lists a message you sent while a turn was running.
18361838
1839That holds when the hook's output is a block alone. If the output sets `continue: false`, even beside `decision: "block"`, or the hook is a prompt hook that answers [`ok: false`](https://code.claude.com/docs/en/hooks#response-schema) without `continueOnBlock: true`, Claude Code stops the message instead of dropping it. The message waits for its own turn, you get a result for it, and its text stays in the conversation, so Claude sees it on the next turn.
1840
18371841When a first reply or result carries `user_message_uuid` without the list, it came from an earlier Claude Code version, so fall back to the single field.
18381842
18391843#### `resume_reason`
from line 5072
50685072};
50695073```
50705074
5071`source` says where the server's definition came from, with the same values and trust rule as [`McpServerProvenance`](#mcpserverprovenance)'s `source`. The field requires Agent SDK v0.3.274 or later and is absent on earlier versions.
5072
5073`_meta` on a `tools` entry carries the MCP Apps members of that tool's `_meta`, so your application can find the `ui://` resource to render with [`readMcpResource()`](#query-object). Claude Code passes through the `ui` object and the deprecated flat `ui/resourceUri` string, and withholds every other key. Inside `ui`, `resourceUri` is a `ui://` string and `visibility` an array of `"model"` and `"app"` when the server sets them, and any other member passes through unchanged. Claude Code drops either key when the value is malformed, and omits `_meta` from a tool that declares neither. The field is present only when the init message's [`capabilities`](#sdksystemmessage) include `mcp_tool_ui_meta_v1`, and requires TypeScript Agent SDK v0.3.280 or later.
5074
5075### `McpServerStatusConfig`
5076
5077The configuration of an MCP server as reported by `mcpServerStatus()`. This is the union of all MCP server transport types.
5078
5079```typescript theme={null}
5080type McpServerStatusConfig =
5081 | McpStdioServerConfig
5082 | McpSSEServerConfig
5083 | McpHttpServerConfig
5084 | McpSdkServerConfig
5085 | McpClaudeAIProxyServerConfig;
5086```
5087
5088See [`McpServerConfig`](#mcpserverconfig) for details on each transport type.
5089
5090### `AccountInfo`
5091
5092Account information for the authenticated user.
5093
5094```typescript theme={null}
5095type AccountInfo = {
5096 email?: string;
5097 organization?: string;
5098 subscriptionType?: string;
5099 tokenSource?: string;
5100 apiKeySource?: string;
5101};
5102```
5103
5104### `ModelUsage`
5105
5106Per-model usage statistics returned in re
5075`source` says where the server's definition came from, with the same values and
No line in this hunk matches that.