Codex "schema must have type 'object'" MCP error: fix
Codex rejects every request with "schema must have type 'object'". Find the MCP tool behind the 400, turn its server off, and see what Sledbot can isolate.
Updated 5 min read
On this page
You updated Codex, and now the desktop app or the CLI fails on every prompt, even "hello":
Invalid schema for function '_search_content': schema must have type 'object' and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level.The message may also include a position such as tools[16].tools[0].parameters.
Why Codex says the schema must have type 'object'
Codex sends the model a list of tools, and each tool has a parameters schema. The API requires that schema to be an object at the top level. It fails when a schema:
- has no
type: object, or - starts with
oneOf,anyOf,allOf,enumornotinstead of describing an object.
The API validates the whole tool list in one request. One bad tool therefore returns a 400 for every prompt, including ones that would never call that tool.
Causes, most common first:
- An MCP server exposes a tool with an invalid schema. Tools like
_search_contentusually come from an MCP server, not from Codex itself. A server update, or a Codex update that now passes the tool through differently, can trigger this. - A server you forgot you configured. The error names the tool and its index, not the server.
- Not an MCP problem. Not known. One community thread (last activity May 22, 2026) reports the Codex desktop app and CLI both failing this way after an update, and the replies asked which model was in use and pointed to GitHub issues. The thread shows no confirmed resolution, so the steps below are a way to isolate the cause, not an official fix.
Fix 1: find the bad server in Codex itself
- Open Terminal and run
codexin a plain folder, outside any Sledbot terminal, so only Codex's own configuration applies. - Disable or remove every MCP server Codex has configured. Codex's CLI documentation on developers.openai.com covers where its configuration lives.
- Send a short prompt. If it works, an MCP tool was the cause.
- Re-enable servers one at a time, sending a prompt after each. When the 400 returns, the server you just enabled has the bad tool.
- Leave that server off, update it, or report the schema problem to its maintainer. The tool needs a top-level object schema.
Fix 2: update and retest
If the error persists with every MCP server disabled, it is probably not an MCP problem.
- Update Codex to the latest version.
- Run the same prompt again in a new session.
- Check Codex's GitHub issues for the same message, since a regression in the client would affect everyone on that version.
Fix 3: isolate it in Sledbot
When an agent launches, Sledbot writes the MCP servers you have connected, plus its own sled mcp, into the agent's MCP configuration. Codex CLI is one of the agents that gets them. Catalogue servers start off, so only servers you enabled, or added as a Custom server, are involved. The error alone cannot show whether an injected server is your cause; these steps find out.
- Open Settings (⌘,) and choose Integrations.
- Under Connected, click Configure… on a server and turn off Enabled. Do this for every server, or for all but one.
- Start a new agent with ⌘T and choose Codex CLI. Servers are added at launch, so an agent that is already running keeps the set it started with.
- If the 400 is gone, re-enable servers one at a time, starting a fresh Codex agent after each, until it returns.
- Leave that server off, or use Remove… in its editor. Removal applies only to agents started afterwards.
Sledbot also has a label, sled.mcp=off, that opts a single launch out of MCP injection. That gives a quick test: if a launch with the label works and a normal launch fails, an injected server is involved.
Which fix applies
| Symptom | Likely cause | Fix |
|---|---|---|
| 400 on every prompt, gone with MCP servers off | A server's tool schema is invalid | Re-enable one by one, keep the bad one off |
| Error returns after re-enabling one server | That server's tool schema is invalid | Keep it off or contact its maintainer |
| Disabled a server in Integrations but an open agent still errors | The agent launched with the old server set | Start a new agent with ⌘T |
| Error persists with every Sledbot server off | Server configured in Codex itself, or not an MCP problem | Run Fix 1, then Fix 2 |
| Error appears only in the Codex desktop app | App has its own server list | Use Fix 1; Sledbot does not control the app |
What Sledbot can't do here
- It only covers Codex CLI agents launched from Sledbot. The Codex desktop app, and servers configured inside Codex itself, are handled with Fix 1.
- The error comes from the model API. Sledbot does not generate it and does not change a server's tools.
- Sledbot does not validate a server's schemas before launch, so the first sign of a bad tool is the 400.
Checklist before you try again
- Every MCP server is off in Codex's own configuration.
- Every server is off under Settings > Integrations in Sledbot, or you launch with
sled.mcp=off. - You started a new agent after changing servers.
- Codex is on its latest version.
- You re-enable only one server per test.
If nothing works
Contact the maintainer of the server you isolated, or OpenAI support if the error persists with all servers off. Include the exact error text, the Codex version, the model, the tool name and position from the message, and the list of MCP servers you had enabled.
Codex fails every request with a 400 after an update:
"Invalid schema for function '_search_content': schema must have type 'object' and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level."
Position: tools[16].tools[0].parameters
Codex version: (your version) Model: (your model)
MCP servers enabled: (list)
Tried: disabled all servers (works / still fails), re-enabled one by one, updated Codex.
Culprit server, if found: (name)For Sledbot questions, use the support page.
Common questions
Why does one tool break every prompt?
The API validates the full tool list on each request. A single invalid schema fails the whole request, whether or not the model would call that tool.
Is this a Sledbot bug?
Nothing shows that. The error comes from the model API, and Sledbot only passes along the MCP servers you connected. Use the label test above to check whether an injected server is involved.
Can I keep the server and disable only the tool?
Not in Sledbot, because Allowed tools is not applied at launch. In Codex itself, check whether its configuration lets you exclude a tool; otherwise ask the server's maintainer to fix the schema.