---
title: What should you log for every MCP tool call?
url: https://opencontroller.lyzr.com/blog/what-to-log-for-every-mcp-tool-call
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# What should you log for every MCP tool call?

**Log who called which tool, on which server and version, for which user, with what decision and outcome. In practice that is about a dozen fields: server, tool, MCP method, session and trace IDs, agent and agent version, user, a hash or redacted copy of the arguments, result size and status, the policy decision and latency. Map them to the OpenTelemetry MCP and GenAI semantic conventions so any backend can read them, and keep raw arguments and results opt-in.**

An auditor reviewing an agent will ask a simple question: show me what it did. For agents that use MCP, "what it did" is mostly tool calls. If you only log model prompts and completions, you are missing the part that changed data.

## Which fields should every tool call record?

Use this checklist. The OpenTelemetry column shows the matching attribute where one exists; these conventions are still marked Development, so pin the version you use.

| # | Field | OpenTelemetry attribute | Why |
|---|---|---|---|
| 1 | Timestamp and duration | Span start and end | Ordering and latency |
| 2 | MCP method | `mcp.method.name` (e.g. `tools/call`) | Separates calls from listing and reads |
| 3 | Tool name | `gen_ai.tool.name` | What was invoked |
| 4 | Tool call ID | `gen_ai.tool.call.id` | Joins the model's request to the call |
| 5 | Server identity and version | `server.address`, plus your registry ID and version | Which server and which build answered |
| 6 | Session ID | `mcp.session.id` | Groups calls in one MCP session |
| 7 | Trace context | `traceparent` in `params._meta` | Links to the agent run and downstream APIs |
| 8 | Protocol version and transport | `mcp.protocol.version`, `network.transport` | Behaviour differs by version and transport |
| 9 | Agent and agent version | `gen_ai.agent.id`, `gen_ai.agent.name`, plus version | Which agent configuration acted |
| 10 | User acted for | From the validated token | Accountability for delegated actions |
| 11 | Arguments | `gen_ai.tool.call.arguments` (opt-in) or a hash | What was asked |
| 12 | Result status and size | `error.type`, `rpc.response.status_code` | Did it work; was data volume unusual |
| 13 | Result content | `gen_ai.tool.call.result` (opt-in) | Only where needed and permitted |
| 14 | Policy decision | Your own attribute | Allowed, blocked, redacted, and the rule that decided |

Fields 10 and 14 are not in the conventions because they come from your identity and policy layers. They matter most to auditors. Our post on [showing which user an agent acted for](/blog/show-which-user-an-ai-agent-acted-for-in-audit-logs) covers field 10 in depth.

## Should you log arguments and results?

The OpenTelemetry conventions make tool arguments and results opt-in for a reason: they often contain personal data, credentials or confidential content. Decide per tool, using these rules.

1. **Default to a hash.** Store a SHA-256 hash of the canonical arguments. You can prove later what was sent, if you hold the original elsewhere, without storing it in logs.
2. **Log arguments in full for high-impact tools.** Payments, deletions, permission changes and outbound messages warrant the full record, with field-level redaction.
3. **Redact before export.** Mask secrets, tokens, card numbers and personal identifiers at the collector or gateway, not in the backend after the fact.
4. **Never log credentials.** Authorization headers and tokens must never appear in arguments, results or span attributes.
5. **Log result size, not content, by default.** A sudden jump in result size is a strong signal of bulk data access.
6. **Separate retention.** Keep metadata (fields 1–10, 12, 14) longer than content (fields 11 and 13), and restrict access to content logs.

## Where should the logging happen?

Log at more than one point, because each sees different things.

- **The MCP client or agent runtime** knows the agent, the user and the model's intent.
- **A gateway in the path** sees every call, can apply policy and records the decision, and covers servers you cannot instrument. See [what an MCP gateway is](/blog/what-is-an-mcp-gateway).
- **The MCP server** knows what it actually did downstream, including errors the client never saw.

Join them with the trace context the client puts in `params._meta`. Without a shared trace ID, three logs become three partial stories.

## How do you check the logging works?

Run three tests each quarter.

1. Pick a random tool call from last month and reconstruct it: agent, version, user, server version, arguments hash, decision and outcome.
2. Trigger a blocked call and confirm the block and the rule that caused it are logged.
3. Search logs for strings that look like tokens or keys. Any hit is a redaction failure.

For failure monitoring on top of this data, see [how to monitor MCP tool call failures](/blog/monitor-mcp-tool-call-failures). For the server-level record that field 5 points to, see [what to record for every MCP server](/blog/mcp-server-inventory-fields). The pillar guide on [how to govern MCP servers](/blog/how-to-govern-mcp-servers) ties logging to approval and runtime control.

## How Opencontroller does this

Opencontroller is built on open standards including MCP and OpenTelemetry. Its governed registry records agents, versions, tools and MCP servers, giving you the registry IDs for fields 5 and 9. Control in the path (allow, route, redact, block) applies where traffic passes through its gateways, and enforcement depth depends on the connector and traffic path. [Book a demo](https://www.lyzr.ai/book-demo/) to see tool-call visibility on your agents.

## Frequently asked questions

**Are the OpenTelemetry MCP conventions stable?**
No. The GenAI and MCP conventions are still marked Development and moved to a dedicated GenAI conventions repository in 2026. Pin a version and expect renames.

**How long should tool call logs be kept?**
Match your existing audit log retention for the systems the tools touch. Keep content logs for a shorter period than metadata.

**Do we need to log tools/list calls?**
Yes, at lower volume. They show which tools an agent could see, which helps explain later behaviour and detect tool list changes.

## Key facts

MCP tool call logging: fields include mcp.method.name, gen_ai.tool.name, gen_ai.tool.call.id, server and version, mcp.session.id, traceparent in params._meta, mcp.protocol.version, network.transport, gen_ai.agent.id/name and version, user from validated token, arguments (gen_ai.tool.call.arguments opt-in or hash), error.type and rpc.response.status_code, result (gen_ai.tool.call.result opt-in), policy decision. OpenTelemetry GenAI and MCP conventions are Development status and moved to the semantic-conventions-genai repository in 2026. Redact at collector or gateway; never log credentials; log result size by default. Opencontroller (Lyzr) uses open standards incl. MCP and OpenTelemetry, with a registry of agents, versions, tools and MCP servers. Pricing starts from $250K per deployment per year.

## Related

- [How do you monitor MCP tool call failures across AI agents?](https://opencontroller.lyzr.com/blog/monitor-mcp-tool-call-failures.md)
- [What should you record for every MCP server in your inventory?](https://opencontroller.lyzr.com/blog/mcp-server-inventory-fields.md)
- [What is an MCP gateway?](https://opencontroller.lyzr.com/blog/what-is-an-mcp-gateway.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
