MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / check_tool_input

Method check_tool_input

crates/core/src/plugins/nemo_guardrails/python.rs:226–241  ·  view source on GitHub ↗
(&self, tool_name: &str, args: &Json)

Source from the content-addressed store, hash-verified

224 }
225
226 async fn check_tool_input(&self, tool_name: &str, args: &Json) -> FlowResult<Json> {
227 let messages = vec![json!({
228 "role": "user",
229 "content": tool_input_content(tool_name, args)?,
230 })];
231
232 match self.bridge.check(messages, LocalRailKind::Input).await? {
233 LocalCheckOutcome::Passed => Ok(args.clone()),
234 LocalCheckOutcome::Blocked { rail, .. } => {
235 Err(blocked_error("tool_input", rail.as_deref()))
236 }
237 LocalCheckOutcome::Modified { content, .. } => {
238 modified_tool_payload(&content, "arguments")
239 }
240 }
241 }
242
243 async fn check_tool_output(
244 &self,

Calls 3

blocked_errorFunction · 0.85
modified_tool_payloadFunction · 0.85
checkMethod · 0.45