MCPcopy
hub / github.com/opentrace/opentrace / _write_tool_call

Function _write_tool_call

agent/src/opentrace_agent/benchmarks/agent.py:633–647  ·  view source on GitHub ↗

Write a formatted tool call to the trace output.

(out: Any, name: str, args: Any, count: int)

Source from the content-addressed store, hash-verified

631
632
633def _write_tool_call(out: Any, name: str, args: Any, count: int) -> None:
634 """Write a formatted tool call to the trace output."""
635 if isinstance(args, dict):
636 parts = []
637 for k, v in args.items():
638 sv = str(v)
639 if len(sv) > 80:
640 sv = sv[:77] + "..."
641 parts.append(f"{k}={sv}")
642 args_str = ", ".join(parts)
643 else:
644 args_str = str(args)[:200]
645
646 out.write(f" {_CYAN}[{count}] {_BOLD}{name}{_RESET}{_CYAN}({args_str}){_RESET}\n")
647 out.flush()
648
649
650def _write_text_block(out: Any, text: str) -> None:

Callers 1

_run_claude_code_tracedFunction · 0.85

Calls 2

writeMethod · 0.80
flushMethod · 0.65

Tested by

no test coverage detected