MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / sanitize_tool_call_entry

Function sanitize_tool_call_entry

python/src/workflow/result.rs:16–25  ·  view source on GitHub ↗

Sanitize a single tool-call-like object: use parameters_masked as parameters and output_masked as output when present, then remove the _masked keys.

(entry: &mut serde_json::Value)

Source from the content-addressed store, hash-verified

14/// Sanitize a single tool-call-like object: use parameters_masked as parameters and
15/// output_masked as output when present, then remove the _masked keys.
16fn sanitize_tool_call_entry(entry: &mut serde_json::Value) {
17 if let Some(obj) = entry.as_object_mut() {
18 if let Some(pm) = obj.remove("parameters_masked") {
19 obj.insert("parameters".to_string(), pm);
20 }
21 if let Some(om) = obj.remove("output_masked") {
22 obj.insert("output".to_string(), om);
23 }
24 }
25}
26
27/// Sanitize a node so that tool call parameters and output exposed in metadata are masked.
28/// Applies to executions[].type=="tool_call", node["tool_calls"], and node["initial_response"]["tool_calls"].

Callers 1

sanitize_node_metadataFunction · 0.85

Calls 3

removeMethod · 0.80
insertMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected