MCPcopy Create free account
hub / github.com/AI45Lab/Code / apply_claude_style_tools_to_agent

Function apply_claude_style_tools_to_agent

core/src/subagent.rs:723–740  ·  view source on GitHub ↗
(
    agent: &mut AgentDefinition,
    tools: &[String],
    disallowed_tools: &[String],
)

Source from the content-addressed store, hash-verified

721}
722
723fn apply_claude_style_tools_to_agent(
724 agent: &mut AgentDefinition,
725 tools: &[String],
726 disallowed_tools: &[String],
727) {
728 if !tools.is_empty() {
729 agent.permissions = allow_only_permission_policy(tools);
730 }
731 if !disallowed_tools.is_empty() {
732 let base = std::mem::take(&mut agent.permissions);
733 agent.permissions = add_denied_tools(base, disallowed_tools);
734 }
735 if (!tools.is_empty() || !disallowed_tools.is_empty())
736 && agent.confirmation_inheritance.is_none()
737 {
738 agent.confirmation_inheritance = Some(ConfirmationInheritance::AutoApprove);
739 }
740}
741
742fn apply_claude_style_tools_to_spec(
743 spec: &mut WorkerAgentSpec,

Callers 1

parse_agent_yaml_valueFunction · 0.85

Calls 3

add_denied_toolsFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected