MCPcopy Index your code
hub / github.com/AI45Lab/Code / set_command_env

Method set_command_env

core/src/tools/registry.rs:188–191  ·  view source on GitHub ↗

Set environment overrides used by subprocess-backed tools when executed without an explicit context.

(&self, env: Arc<HashMap<String, String>>)

Source from the content-addressed store, hash-verified

186 /// Set environment overrides used by subprocess-backed tools when executed
187 /// without an explicit context.
188 pub fn set_command_env(&self, env: Arc<HashMap<String, String>>) {
189 let mut ctx = self.context.write().unwrap();
190 *ctx = ctx.clone().with_command_env(env);
191 }
192
193 /// Execute a tool by name using the registry's default context
194 pub async fn execute(&self, name: &str, args: &serde_json::Value) -> Result<ToolResult> {

Callers 2

buildMethod · 0.80

Calls 3

writeMethod · 0.80
with_command_envMethod · 0.80
cloneMethod · 0.45