Agent SDK reference - TypeScript changedagent-sdk/typescript
Nearest release: v2.1.251, published 8 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+10added
Lines−7removed
From line
173
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits115to this page, all time
The whole hunk
from line 173, 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 173
173173 instructions?: string;
174174 tools?: Array<SdkMcpToolDefinition<any>>;
175175 alwaysLoad?: boolean;
176 timeout?: number;
176177}): McpSdkServerConfigWithInstance;
177178```
178179
179180#### Parameters
180181
181| Parameter | Type | Description |
182| :--------------------- | :---------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
183| `options.name` | `string` | The name of the MCP server |
184| `options.version` | `string` | Optional version string |
185| `options.instructions` | `string` | Optional server instructions, returned from `initialize` and surfaced to the model as an MCP instructions block |
186| `options.tools` | `Array<SdkMcpToolDefinition>` | Array of tool definitions created with [`tool()`](#tool) |
187| `options.alwaysLoad` | `boolean` | When `true`, every tool from this server stays in the initial prompt and is never deferred behind [tool search](/docs/en/agent-sdk/tool-search). Combines with per-tool `alwaysLoad` in [`tool()`](#tool) |
182| Parameter | Type | Description |
183| :--------------------- | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
184| `options.name` | `string` | The name of the MCP server |
185| `options.version` | `string` | Optional version string |
186| `options.instructions` | `string` | Optional server instructions, returned from `initialize` and surfaced to the model as an MCP instructions block |
187| `options.tools` | `Array<SdkMcpToolDefinition>` | Array of tool definitions created with [`tool()`](#tool) |
188| `options.alwaysLoad` | `boolean` | When `true`, every tool from this server stays in the initial prompt and is never deferred behind [tool search](/docs/en/agent-sdk/tool-search). Combines with per-tool `alwaysLoad` in [`tool()`](#tool) |
189| `options.timeout` | `number` | Timeout in milliseconds for this server's tool calls. Claude Code applies it to this server in place of [`MCP_TOOL_TIMEOUT`](/docs/en/env-vars). Pass a whole number of at least 1000. Claude Code ignores other values. Requires TypeScript Agent SDK v0.3.248 or later |
188190
189191### `listSessions()`
190192
from line 1054
10521054type McpSdkServerConfigWithInstance = {
10531055 type: "sdk";
10541056 name: string;
1057 timeout?: number;
10551058 instance: McpServer;
10561059};
10571060```
from line 3747
37443747
37453748### ReadMcpResource
37463749
3747**Tool name:** `ReadMcpResourceTool`
3748
3749```typescript theme={null}
3750type ReadMcpResourceOutput = {
3751 contents: Array<{
3752 uri: string;
3753 mimeType?: string;
3754 text?: string;
3755 blobSavedTo?: string;
3756 }>;
3757 error?: string;
3758};
3759```
3760
3761Returns the contents of the requested MCP resource.
3762
3763### EnterWorktree
3764
3765**Tool name:** `EnterWorktree`
3766
3767```typescript theme={null}
3768type EnterWorktreeOutput = {
3769 worktreePath: string;
3770 worktreeBranch?: string;
3771 message: string;
3772};
3773```
3774
3775Returns information about the git worktree.
3776
3777### ExitWorktree
3778
3779**Tool name:** `ExitWorktree`
3780
3781```typescript theme={null}
3782type ExitWorktreeOutput = {
3783 action: "keep" | "remove";
3784 originalCwd: string;
3785 worktreePath: string;
3786 worktreeBranch?: string;
3787 tmuxSessionName?: string;
3788 discardedFiles?: number;
3789 discardedCommits?: number;
No line in this hunk matches that.