Skip to main content

Module agents

Module agents 

Source
Available on crate feature managed-agents-preview only.
Expand description

Agents: full CRUD + version history.

An agent defines how Claude behaves within a session: model (optionally with fast inference speed), system prompt, MCP servers, skills, tools (built-in toolset + MCP toolsets + custom tools), description, metadata. Agents are versioned – creating one starts at version 1 and any Agents::update increments the version. Sessions reference agents either at the latest version (string ID) or pinned to a specific version (see AgentRef).

§Forward compatibility

All wrapper enums in this module follow the Known | Other(serde_json::Value) pattern. Brand-new server variants – a new permission policy, a new toolset shape, a new skill type – deserialize into Other preserving the raw JSON, so upgrading the server without upgrading the SDK doesn’t break parsing.

Structs§

Agent
An agent definition.
Agents
Namespace handle for the Agents API.
AnthropicSkill
Body of Skill::Anthropic.
BuiltinToolConfig
Per-tool override on a built-in toolset.
BuiltinToolset
Body of AgentTool::BuiltinToolset.
CallableAgent
Reference to another agent that this agent is permitted to call.
CreateAgentRequest
Request body for POST /v1/agents.
CreateAgentRequestBuilder
Builder for CreateAgentRequest.
CustomSkill
Body of Skill::Custom.
CustomTool
Custom tool executed by the API client (not the agent). Calls surface as agent.custom_tool_use events; respond with user.custom_tool_result.
CustomToolInputSchema
JSON Schema for a custom tool’s input parameters.
ListAgentVersionsParams
Optional knobs for Agents::list_versions.
ListAgentsParams
Optional knobs for Agents::list.
McpToolConfig
Per-tool override on an MCP toolset.
McpToolset
Body of AgentTool::McpToolset.
MetadataPatch
Metadata patch on UpdateAgentRequest. Each entry is either a String (upsert that key to the given value) or None (delete that key). Keys not present in the patch are preserved.
ToolsetDefaultConfig
Default configuration for all tools in a toolset.
UpdateAgentRequest
Request body for POST /v1/agents/{id} (update).

Enums§

AgentMcpServer
MCP server reference on an agent.
AgentModel
Model identifier. Wire form is either a bare string or a {id, speed} object.
AgentTool
One tool entry on an agent.
BuiltinToolName
Built-in agent tool identifier.
ModelSpeed
Inference speed mode. Fast charges premium pricing; not all models support it.
PermissionPolicy
Permission policy controlling whether tool calls require user confirmation. Forward-compatible: unknown policy types fall through to Self::Other.
Skill
A skill referenced on an agent. Forward-compatible: unknown skill types fall through to Self::Other.