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

Method check_before_tool

sdk/node/src/lib.rs:5224–5236  ·  view source on GitHub ↗
(
        &self,
        session_id: &str,
        tool_name: &str,
    )

Source from the content-addressed store, hash-verified

5222 }
5223
5224 async fn check_before_tool(
5225 &self,
5226 session_id: &str,
5227 tool_name: &str,
5228 ) -> a3s_code_core::budget::BudgetDecision {
5229 let Some(tsfn) = self.check_before_tool.as_ref() else {
5230 return a3s_code_core::budget::BudgetDecision::Allow;
5231 };
5232 self.call_decision(
5233 tsfn,
5234 serde_json::json!({ "sessionId": session_id, "toolName": tool_name }),
5235 )
5236 }
5237}
5238
5239/// Parse the return value of a JS BudgetGuard callback into a

Callers

nothing calls this directly

Calls 1

call_decisionMethod · 0.80

Tested by

no test coverage detected