codex - 💡(How to fix) Fix Expose callId in MCP tool call _meta for all servers [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#21044Fetched 2026-05-05 05:54:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
2
Author
Participants
Timeline (top)
labeled ×3unlabeled ×1

When Codex dispatches an MCP tool call, the tool call's call_id is passed to build_mcp_tool_call_request_meta, but only included in _meta for the codex_apps server, nested under _codex_apps.call_id. Custom MCP servers receive no identifier for the originating tool call.

Root Cause

When Codex dispatches an MCP tool call, the tool call's call_id is passed to build_mcp_tool_call_request_meta, but only included in _meta for the codex_apps server, nested under _codex_apps.call_id. Custom MCP servers receive no identifier for the originating tool call.

Fix Action

Fix / Workaround

When Codex dispatches an MCP tool call, the tool call's call_id is passed to build_mcp_tool_call_request_meta, but only included in _meta for the codex_apps server, nested under _codex_apps.call_id. Custom MCP servers receive no identifier for the originating tool call.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

Context

When Codex dispatches an MCP tool call, the tool call's call_id is passed to build_mcp_tool_call_request_meta, but only included in _meta for the codex_apps server, nested under _codex_apps.call_id. Custom MCP servers receive no identifier for the originating tool call.

Ask

Add callId at the top level of _meta for all MCP servers, following the same pattern as threadId (which is already injected unconditionally via with_mcp_tool_call_thread_id_meta).

Use cases:

  • Tracing / observability: correlate client-side spans with server-side processing.
  • Audit logging: track which model action triggered which server-side operation.
  • Request deduplication: detect retried or duplicate tool calls on the server side.

Additional information

call_id is already a parameter of build_mcp_tool_call_request_meta. It just needs to be inserted unconditionally.

Happy to submit a PR with tests if the team is open to this change.

extent analysis

TL;DR

Add callId at the top level of _meta for all MCP servers to enable tracing, audit logging, and request deduplication.

Guidance

  • Modify the build_mcp_tool_call_request_meta function to include call_id at the top level of _meta, similar to threadId.
  • Verify the change by checking the _meta object in the MCP tool call request for the presence of callId.
  • Test the change with custom MCP servers to ensure they receive the callId identifier.
  • Consider adding tests to cover the new behavior, as mentioned in the issue.

Example

No code snippet is provided, as the issue does not contain sufficient code context.

Notes

The proposed change requires modifying the build_mcp_tool_call_request_meta function, which may have implications for existing code that relies on the current behavior.

Recommendation

Apply workaround: Modify the build_mcp_tool_call_request_meta function to include call_id at the top level of _meta, as this change is necessary to enable the desired use cases and is a targeted fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING