codex - 💡(How to fix) Fix Stale MCP Tool Schema After Server Restart [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#19155Fetched 2026-04-24 05:59:43
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3unlabeled ×1

Error Message

Mcp error: -32602: invalid params: validating "arguments": validating root: unexpected additional properties ["duration"]

Fix Action

Fix / Workaround

Current workaround

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.122.0

What subscription do you have?

Business

Which model were you using?

gpt-5.4 high

What platform is your computer?

Linux 5.4.0-216-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

What issue are you seeing?

Codex appears to keep a stale MCP tool schema in-session, even when the server emits notifications/tools/list_changed.

What steps can reproduce the bug?

  1. Start Codex with an MCP server exposing:
    • tool: count_detections
    • required input: duration
  2. Call it successfully: {"duration":"1h"}
  3. Change the server so the same tool name now requires:
    • lookback
    • not duration
  4. Rebuild and restart the MCP server.
  5. Server replays initialization and emits notifications/tools/list_changed.
  6. In the same Codex session, call the tool again.

Codex still uses the old schema and the call fails with: Mcp error: -32602: invalid params: validating "arguments": validating root: unexpected additional properties ["duration"]

What is the expected behavior?

After notifications/tools/list_changed, Codex should refresh the tool definition and use the updated schema in the same session.

Additional information

Control

A fresh MCP client connected to the same restarted server immediately sees the new schema and can call the tool correctly, so this looks like a Codex-side stale cache/binding issue rather than an MCP server restart issue.

Current workaround

  • restart Codex after breaking MCP schema changes
  • or version tool names / temporarily accept both old and new params

extent analysis

TL;DR

The most likely fix is to implement a mechanism for Codex to refresh its tool definition cache when it receives a notifications/tools/list_changed notification from the MCP server.

Guidance

  • Investigate the Codex codebase to identify where the tool schema is cached and how it is updated.
  • Verify that the notifications/tools/list_changed notification is being properly handled by Codex and that it triggers an update to the tool schema cache.
  • Consider implementing a cache invalidation mechanism that is triggered by the notifications/tools/list_changed notification to ensure that Codex always uses the latest tool schema.
  • Review the current workaround of restarting Codex after breaking MCP schema changes to understand its implications and potential limitations.

Example

No code snippet is provided as the issue does not contain sufficient information about the Codex codebase.

Notes

The issue appears to be specific to the Codex CLI and its interaction with the MCP server, and may not be applicable to other versions or configurations.

Recommendation

Apply workaround: restart Codex after breaking MCP schema changes, as this is the currently known method to ensure that Codex uses the updated tool schema. This workaround should be used until a more permanent fix can be implemented to refresh the tool definition cache in response to notifications/tools/list_changed notifications.

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

codex - 💡(How to fix) Fix Stale MCP Tool Schema After Server Restart [1 participants]