pub struct AgentSpec {
pub name: String,
pub description: String,
pub model: String,
pub reasoning_effort: Option<ReasoningEffort>,
pub prompts: Vec<Prompt>,
pub mcp_config_paths: Vec<PathBuf>,
pub exposure: AgentSpecExposure,
pub tools: ToolFilter,
}Expand description
A resolved agent specification ready for runtime use.
This type is produced by validating and resolving authored agent configuration. All validation happens before constructing these runtime types.
Fields§
§name: StringThe canonical lookup key for this agent.
description: StringHuman-readable description of this agent’s purpose.
model: StringThe validated model spec to use for this agent.
This is stored as a canonical string so authored settings can represent
both single models (provider:model) and alloy specs
(provider1:model1,provider2:model2).
reasoning_effort: Option<ReasoningEffort>Optional reasoning effort level for models that support it.
prompts: Vec<Prompt>The prompt stack for this agent.
For authored AgentSpecs resolved from settings, this contains authored prompt
variants (e.g., Prompt::PromptGlobs). Prompt files may include
!`<shell command>` markers which are replaced by the trimmed stdout of
the command at prompt-load time. Prompt::McpInstructions is added separately
during agent construction.
mcp_config_paths: Vec<PathBuf>Resolved MCP config paths for this agent, applied in order.
On server name collisions across files, the last entry in the list wins. Before catalog resolution, this holds agent-local overrides (empty if none). After catalog resolution, this holds the effective list (agent-local > inherited > cwd/mcp.json).
exposure: AgentSpecExposureHow this agent can be invoked.
tools: ToolFilterTool filter for restricting which MCP tools this agent can use.
Implementations§
Source§impl AgentSpec
impl AgentSpec
Sourcepub fn default_spec(
model: &LlmModel,
reasoning_effort: Option<ReasoningEffort>,
prompts: Vec<Prompt>,
) -> Self
pub fn default_spec( model: &LlmModel, reasoning_effort: Option<ReasoningEffort>, prompts: Vec<Prompt>, ) -> Self
Create a default (no-mode) agent spec with inherited prompts.
Sourcepub fn resolve_mcp_config(&mut self, inherited: &[PathBuf], cwd: &Path)
pub fn resolve_mcp_config(&mut self, inherited: &[PathBuf], cwd: &Path)
Resolve effective MCP config paths in place using precedence:
- Agent’s own
mcp_config_paths(kept as-is if non-empty) inheritedpaths from settings (if non-empty)cwd/mcp.json(becomes a single-element list if it exists)