Claude Platform Docs

代理

创建代理
BetaManagedAgentsAgent Beta.Agents.Create(parameters, cancellationToken = default)
POST/v1/agents
列出代理
AgentListPage Beta.Agents.List(parameters, cancellationToken = default)
GET/v1/agents
获取代理
BetaManagedAgentsAgent Beta.Agents.Retrieve(parameters, cancellationToken = default)
GET/v1/agents/{agent_id}
更新代理
BetaManagedAgentsAgent Beta.Agents.Update(parameters, cancellationToken = default)
POST/v1/agents/{agent_id}
归档代理
BetaManagedAgentsAgent Beta.Agents.Archive(parameters, cancellationToken = default)
POST/v1/agents/{agent_id}/archive
Models
class BetaManagedAgentsAdvisor { Type; Model; }

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

required Type Type
required string Model

The advisor model id.

class BetaManagedAgentsAgent { Type; ID; ArchivedAt; /* 12 more */ }

A Managed Agents agent.

class BetaManagedAgentsAgentReference { Type; ID; Version; }

A resolved agent reference with a concrete version.

required Type Type
required string ID
required int Version
formatint32
class BetaManagedAgentsAgentToolConfig: union

Configuration for a specific agent tool.

class BetaManagedAgentsAgentToolConfigParams: union

Configuration override for a specific tool within a toolset.

class BetaManagedAgentsAgentToolsetDefaultConfig { Enabled; PermissionPolicy; }

Resolved default configuration for agent tools.

required bool Enabled
required PermissionPolicy PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsAgentToolsetDefaultConfigParams { Enabled; PermissionPolicy; }

Default configuration for all tools in a toolset.

bool? Enabled

Whether tools are enabled and available to Claude by default. Defaults to true if not specified.

PermissionPolicy? PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsAgentToolset20260401 { Type; Configs; DefaultConfig; }
class BetaManagedAgentsAgentToolset20260401BashInput { Command; Restart; TimeoutMs; }

Input payload for the bash tool of the agent_toolset_20260401 toolset. All fields are optional; a normal invocation supplies command, while restart=true (with no command) reboots the runner-side bash session.

string Command

Shell command to execute. Omit only when restart is true.

bool Restart

When true, restart the persistent bash session instead of running a command. Subsequent calls without restart will run against the fresh session.

long TimeoutMs

Per-call timeout in milliseconds. Defaults to the runner-wide tool timeout when omitted or zero.

minimum0
class BetaManagedAgentsAgentToolset20260401EditInput { FilePath; NewString; OldString; ReplaceAll; }

Input payload for the edit tool. Performs a string replacement in the named file; by default old_string must occur exactly once.

required string FilePath

Path of the file to edit.

required string NewString

Replacement text.

required string OldString

Substring to find and replace.

bool ReplaceAll

When true, replace every occurrence of old_string instead of requiring a unique match.

class BetaManagedAgentsAgentToolset20260401GlobInput { Pattern; Path; }

Input payload for the glob tool. Returns paths matching a doublestar glob pattern, newest first.

required string Pattern

Doublestar glob pattern (e.g. **/*.go). Absolute patterns are only permitted when the runner is configured to allow them.

string Path

Optional directory root to search under. Defaults to the runner's working directory.

class BetaManagedAgentsAgentToolset20260401GrepInput { Pattern; Path; }

Input payload for the grep tool. Searches file contents for a regular expression, returning matching lines.

required string Pattern

Regular expression to search for.

string Path

Optional directory root to search under. Defaults to the runner's working directory.

class BetaManagedAgentsAgentToolset20260401Params { Type; Configs; DefaultConfig; }

Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

class BetaManagedAgentsAgentToolset20260401ReadInput { FilePath; ViewRange; }

Input payload for the read tool. Reads file contents relative to the runner's working directory (or absolute when the runner permits).

required string FilePath

Path of the file to read.

IReadOnlyList<long> ViewRange

Optional [start_line, end_line] 1-indexed inclusive range. When omitted the entire file is returned. end_line of 0 or negative means "to end of file".

minItems2
maxItems2
class BetaManagedAgentsAgentToolset20260401WriteInput { Content; FilePath; }

Input payload for the write tool. Writes (overwriting) the entire file contents.

required string Content

Full file contents to write.

required string FilePath

Path of the file to write.

class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAnthropicSkill { Type; SkillID; Version; }

A resolved Anthropic-managed skill.

required Type Type
required string SkillID
required string Version
class BetaManagedAgentsAnthropicSkillParams { Type; SkillID; Version; }

An Anthropic-managed skill.

required Type Type
required string SkillID

Identifier of the Anthropic skill (e.g., "xlsx").

minLength1
maxLength64
string? Version

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsBashToolConfig { Type = "bash"; Enabled; Name; PermissionPolicy; }

Configuration for the bash tool.

class BetaManagedAgentsBashToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the bash tool.

class BetaManagedAgentsCustomSkill { Type; SkillID; Version; }

A resolved user-created custom skill.

required Type Type
required string SkillID
required string Version
class BetaManagedAgentsCustomSkillParams { Type; SkillID; Version; }

A user-created custom skill.

required Type Type
required string SkillID

Tagged ID of the custom skill (e.g., "skill_01XJ5...").

minLength1
maxLength64
string? Version

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
class BetaManagedAgentsCustomTool { Type; Description; InputSchema; Name; }

A custom tool as returned in API responses.

required Type Type
required string Description

JSON Schema for custom tool input parameters.

JsonElement Type = "object"
IReadOnlyDictionary<string, JsonElement>? Properties
IReadOnlyList<string>? Required
required string Name
class BetaManagedAgentsCustomToolInputSchema { Type = "object"; Properties; Required; }

JSON Schema for custom tool input parameters.

JsonElement Type = "object"
IReadOnlyDictionary<string, JsonElement>? Properties
IReadOnlyList<string>? Required
class BetaManagedAgentsCustomToolParams { Type; Description; InputSchema; Name; }

A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an agent.custom_tool_use event is emitted and the session goes idle, waiting for the client to provide the result via a user.custom_tool_result event.

required Type Type
required string Description

Description of what the tool does, shown to the agent to help it decide when to use the tool.

minLength1

JSON Schema for custom tool input parameters.

JsonElement Type = "object"
IReadOnlyDictionary<string, JsonElement>? Properties
IReadOnlyList<string>? Required
required string Name

Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.

minLength1
maxLength128
class BetaManagedAgentsEditToolConfig { Type = "edit"; Enabled; Name; PermissionPolicy; }

Configuration for the edit tool.

class BetaManagedAgentsEditToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the edit tool.

class BetaManagedAgentsEffortHigh { Type; }

High effort. Favors reasoning depth.

required Type Type
class BetaManagedAgentsEffortLow { Type; }

Low effort. Favors latency over reasoning depth.

required Type Type
class BetaManagedAgentsEffortMax { Type; }

Maximum effort. Favors reasoning depth over latency.

required Type Type
class BetaManagedAgentsEffortMedium { Type; }

Medium effort. Balances latency and reasoning depth.

required Type Type
class BetaManagedAgentsEffortXhigh { Type; }

Extra-high effort. Not all models accept this level.

required Type Type
class BetaManagedAgentsGlobToolConfig { Type = "glob"; Enabled; Name; PermissionPolicy; }

Configuration for the glob tool.

class BetaManagedAgentsGlobToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the glob tool.

class BetaManagedAgentsGrepToolConfig { Type = "grep"; Enabled; Name; PermissionPolicy; }

Configuration for the grep tool.

class BetaManagedAgentsGrepToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the grep tool.

class BetaManagedAgentsMcpServerUrlDefinition { Type; Name; Url; }

URL-based MCP server connection as returned in API responses.

required Type Type
required string Name
required string Url
class BetaManagedAgentsMcpToolConfig { Enabled; Name; PermissionPolicy; }

Resolved configuration for a specific MCP tool.

required bool Enabled
required string Name
required PermissionPolicy PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsMcpToolConfigParams { Name; Enabled; PermissionPolicy; }

Configuration override for a specific MCP tool.

required string Name

Name of the MCP tool to configure. 1-128 characters.

minLength1
maxLength128
bool? Enabled

Whether this tool is enabled. Overrides the default_config setting.

PermissionPolicy? PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsMcpToolset { Type; Configs; DefaultConfig; McpServerName; }
class BetaManagedAgentsMcpToolsetDefaultConfig { Enabled; PermissionPolicy; }

Resolved default configuration for all tools from an MCP server.

required bool Enabled
required PermissionPolicy PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsMcpToolsetDefaultConfigParams { Enabled; PermissionPolicy; }

Default configuration for all tools from an MCP server.

bool? Enabled

Whether tools are enabled by default. Defaults to true if not specified.

PermissionPolicy? PermissionPolicy

Permission policy for tool execution.

One of the following:
class BetaManagedAgentsAlwaysAllowPolicy { Type; }

Tool calls are automatically approved without user confirmation.

required Type Type
class BetaManagedAgentsAlwaysAskPolicy { Type; }

Tool calls require user confirmation before execution.

required Type Type
class BetaManagedAgentsAutoPolicy { Type = "auto"; }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

JsonElement Type = "auto"
class BetaManagedAgentsMcpToolsetParams { Type; McpServerName; Configs; DefaultConfig; }

Configuration for tools from an MCP server defined in mcp_servers.

class BetaManagedAgentsModelConfig { ID; Effort; InferenceGeo; Speed; }

Model identifier and configuration.

class BetaManagedAgentsModelConfigParams { ID; Effort; InferenceGeo; Speed; }

An object that defines additional configuration control over model use

class BetaManagedAgentsMultiagentCoordinator { Type; Agents; }

Resolved coordinator topology with a concrete agent roster.

required Type Type
required IReadOnlyList<Agent> Agents

Agents the coordinator may spawn as session threads, each resolved to a specific version.

One of the following:
class BetaManagedAgentsAgentReference { Type; ID; Version; }

A resolved agent reference with a concrete version.

required Type Type
required string ID
required int Version
formatint32
class BetaManagedAgentsAdvisor { Type; Model; }

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

required Type Type
required string Model

The advisor model id.

class BetaManagedAgentsMultiagentCoordinatorParams { Type; Agents; }

A coordinator topology: the session's primary thread orchestrates work by spawning session threads, each running an agent drawn from the agents roster.

class BetaManagedAgentsMultiagentSelfParams { Type; }

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

required Type Type
class BetaManagedAgentsReadToolConfig { Type = "read"; Enabled; Name; PermissionPolicy; }

Configuration for the read tool.

class BetaManagedAgentsReadToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the read tool.

class BetaManagedAgentsSessionThreadAgent { Type; ID; Description; /* 7 more */ }

Resolved agent definition for a single session_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from Session.agent.

class BetaManagedAgentsSkillParams: union

Skill to load in the session container.

class BetaManagedAgentsAnthropicSkillParams { Type; SkillID; Version; }

An Anthropic-managed skill.

required Type Type
required string SkillID

Identifier of the Anthropic skill (e.g., "xlsx").

minLength1
maxLength64
string? Version

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
class BetaManagedAgentsCustomSkillParams { Type; SkillID; Version; }

A user-created custom skill.

required Type Type
required string SkillID

Tagged ID of the custom skill (e.g., "skill_01XJ5...").

minLength1
maxLength64
string? Version

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
class BetaManagedAgentsUrlMcpServerParams { Type; Name; Url; }

URL-based MCP server connection.

required Type Type
required string Name

Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.

minLength1
maxLength255
required string Url

Endpoint URL for the MCP server.

maxLength2048
class BetaManagedAgentsUserLocation { Type = "approximate"; City; Country; /* 2 more */ }

Approximate user location for search result localization.

JsonElement Type = "approximate"

Location precision. Only "approximate" is supported.

string? City

City name.

minLength1
maxLength255
string? Country

Two-letter ISO 3166-1 country code, uppercase.

string? Region

Region or state name.

minLength1
maxLength255
string? Timezone

IANA timezone identifier, e.g. "America/Los_Angeles".

minLength1
maxLength255
class BetaManagedAgentsWebFetchToolConfig { Type = "web_fetch"; Enabled; Name; /* 4 more */ }

Configuration for the web_fetch tool.

class BetaManagedAgentsWebFetchToolConfigParams { Type; Name; AllowedDomains; /* 4 more */ }

Configuration override for the web_fetch tool.

class BetaManagedAgentsWebSearchToolConfig { Type = "web_search"; Enabled; Name; /* 4 more */ }

Configuration for the web_search tool.

class BetaManagedAgentsWebSearchToolConfigParams { Type; Name; AllowedDomains; /* 4 more */ }

Configuration override for the web_search tool.

class BetaManagedAgentsWriteToolConfig { Type = "write"; Enabled; Name; PermissionPolicy; }

Configuration for the write tool.

class BetaManagedAgentsWriteToolConfigParams { Type; Name; Enabled; PermissionPolicy; }

Configuration override for the write tool.

代理版本

列出代理版本
VersionListPage Beta.Agents.Versions.List(parameters, cancellationToken = default)
GET/v1/agents/{agent_id}/versions