Skip to content

Add toollog option and record MCP tool usage#104

Draft
nmaguiar wants to merge 1 commit intomainfrom
codex/add-toollog-option-for-tool-use-logging
Draft

Add toollog option and record MCP tool usage#104
nmaguiar wants to merge 1 commit intomainfrom
codex/add-toollog-option-for-tool-use-logging

Conversation

@nmaguiar
Copy link
Contributor

@nmaguiar nmaguiar commented Feb 15, 2026

Motivation

  • Provide dedicated, structured observability for MCP tool calls (inputs, outputs, cache and error flags) comparable to the existing auditch interaction audit.
  • Make tool-level tracing available in both streaming and non-streaming runs so troubleshooting tool flows is straightforward.
  • Expose the option across CLI/web schemas and docs so users can enable tool logging the same way they enable auditch.

Description

  • Added a new runtime flag toollog and a _toollogon internal flag that initializes a _mini_a_toollog_channel from a JSSLON channel definition when supplied.
  • Implemented MiniA.prototype._logToolUsage(toolName, params, answer, meta) to persist tool events (timestamp, tool, params, answer, connection id, cache flag, error flag) to _mini_a_toollog_channel when enabled.
  • Integrated tool logging into the MCP execution path (_executeToolWithCache) to record cache hits, circuit-open failures, call exceptions, and successful results so all call outcomes are captured.
  • Exposed and validated the toollog option in mini-a.yaml and mini-a-web.yaml, added the CLI/UI parameter in mini-a-con.js, and documented it in USAGE.md.

Testing

  • Ran static syntax check with node --check mini-a.js which succeeded.
  • Attempted to run the automated utility suite with ojob tests/miniAUtils.yaml but the ojob command is not available in this environment, so those tests were not executed here.
  • Basic smoke checks: the modified code was inspected and the new logging calls are placed at cache hit, error, circuit, and normal-success locations in _executeToolWithCache to ensure coverage across call paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant