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

Function record_tool_result_metadata

core/src/agent/telemetry_runtime.rs:15–30  ·  view source on GitHub ↗
(tool_name: &str, args: &serde_json::Value, exit_code: i32)

Source from the content-addressed store, hash-verified

13}
14
15fn record_tool_result_metadata(tool_name: &str, args: &serde_json::Value, exit_code: i32) {
16 let span = tracing::Span::current();
17 span.record(crate::telemetry::ATTR_TOOL_NAME, tool_name);
18 span.record(crate::telemetry::ATTR_TOOL_EXIT_CODE, exit_code as i64);
19 span.record(crate::telemetry::ATTR_TOOL_SUCCESS, exit_code == 0);
20
21 tracing::debug!(
22 a3s.tool.name = tool_name,
23 a3s.tool.exit_code = exit_code,
24 a3s.tool.success = exit_code == 0,
25 a3s.tool.args_bytes = serde_json::to_string(args)
26 .map(|s| s.len())
27 .unwrap_or_default(),
28 "Tool execution result recorded"
29 );
30}
31
32#[cfg(test)]
33mod tests {

Calls 1

recordMethod · 0.45