pub struct AgentDefinition {
pub description: String,
pub prompt: String,
pub tools: Option<Vec<String>>,
pub model: Option<String>,
}Expand description
Configuration for a programmatically defined subagent.
Subagents are specialized agents that can be invoked by the main Claude Code agent for specific tasks.
§Fields
description— Natural language description of when to use this agent.prompt— The agent’s system prompt.tools— Optional list of allowed tool names. If omitted, inherits all tools.model— Optional model override (e.g.,"sonnet","opus","haiku","inherit"). If omitted, uses the main model.
Fields§
§description: StringHuman-readable description of when this agent should be used.
prompt: StringThe sub-agent system prompt.
tools: Option<Vec<String>>Optional tool allowlist for this sub-agent.
model: Option<String>Optional model override for this sub-agent.
Trait Implementations§
Source§impl Clone for AgentDefinition
impl Clone for AgentDefinition
Source§fn clone(&self) -> AgentDefinition
fn clone(&self) -> AgentDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentDefinition
impl Debug for AgentDefinition
Source§impl<'de> Deserialize<'de> for AgentDefinition
impl<'de> Deserialize<'de> for AgentDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AgentDefinition
impl PartialEq for AgentDefinition
Source§impl Serialize for AgentDefinition
impl Serialize for AgentDefinition
impl StructuralPartialEq for AgentDefinition
Auto Trait Implementations§
impl Freeze for AgentDefinition
impl RefUnwindSafe for AgentDefinition
impl Send for AgentDefinition
impl Sync for AgentDefinition
impl Unpin for AgentDefinition
impl UnsafeUnpin for AgentDefinition
impl UnwindSafe for AgentDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more