Skip to content

Add an opt-in trace of the tool calls agents make through the bridge - #11

Closed
jargnar wants to merge 1 commit into
prooflinedev:mainfrom
jargnar:tool-call-trace
Closed

jargnar wants to merge 1 commit into
prooflinedev:mainfrom
jargnar:tool-call-trace

Conversation

@jargnar

@jargnar jargnar commented Nov 15, 2026

Copy link
Copy Markdown

One agent session through the bridge with PROOFLINE_MCP_TRACE set, then the trace and its summary

With PROOFLINE_MCP_TRACE set to a file path, the bridge appends one JSON line for each message once it has answered it: the time, the method, the tool name of a tools/call, the outcome, the time spent waiting on the server, the sizes of the request and of the answer, and the HTTP status or JSON-RPC error code where there is one. proofline-mcp --trace-summary <file> prints the calls, the failures, and the median and longest duration for each tool.

The bridge is the one place where everything an agent asks Proofline passes through, and it says nothing unless it fails. A team that connects agents to Proofline cannot tell which tools the agents call, how long each call takes, or how often one is refused. I have traced and measured millions of tool calls of my own agents, and the first finding was that agents do not use tools the way their authors expect.

A line never holds the token, parameters or tool arguments, results, error messages, bodies from the server, or request ids. A test searches the trace for each of them. Without the variable nothing changes: no file is written, and over eleven runs, failures included, the exit code and the bytes on stdout and stderr are the same as on main.

Validation: npm run check && npm test && npm run test:package, the CI line, passes on Node 22.23.2 at 3a2ff75: 18 of 18 tests, and 18 of 18 again on the installed tarball, which holds src/trace.js. Of the 8 new tests, 7 fail on main, and the eighth pins what stays the same without the variable. This ran locally on Linux arm64. GitHub Actions has not run it, and nothing was run against proofline.sh.

Self-review: bridge() takes one more optional argument and counts the bytes it writes. Nothing else changes on the default path. A trace that cannot be opened is a configuration failure before any request is sent. The path must be a regular file, so the trace cannot be pointed at the protocol stream. If a write fails later, tracing stops with one line on stderr and the session goes on. The summary escapes non-printable characters in tool names and skips malformed lines. Risk: one synchronous append for each message, on a bridge that is already serial. Its cost on a slow disk is not measured.

The recording is bash demo.sh in this checkout, against a stand-in for the hosted server on 127.0.0.1 and with no token: demo.sh, its output as text.

🤖 Generated with Claude Code

With PROOFLINE_MCP_TRACE set to a file, the bridge appends one JSON line for each message it answers: method, tool name, outcome, duration and sizes, never content. proofline-mcp --trace-summary <file> prints calls, failures and durations for each tool. Without the variable nothing changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

mohsen1 commented Nov 17, 2026

Copy link
Copy Markdown
Member

Codex

Closing as out of scope. We’re keeping the MCP bridge focused and aren’t expanding its feature set.

@mohsen1 mohsen1 closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants