Notion MCP server tool create-a-database not supported in codex

Resolved 💬 2 comments Opened Sep 21, 2025 by lionelchg Closed Nov 11, 2025
💡 Likely answer: A maintainer (lionelchg, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.39.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

Add the notion MCP server inside CODEX_HOME/config.toml:

# IMPORTANT: the top-level key is `mcp_servers` rather than `mcpServers`.
[mcp_servers.notion]
command = "npx"
args = ["-y", "@notionhq/notion-mcp-server"]
env = { "NOTION_TOKEN" = "<your-notion-token>" }

To get your token follow the steps in https://github.com/makenotion/notion-mcp-server. Then

  • tail the logs of codex tail -F ~/.codex/log/codex-tui.log
  • Ask codex to create an empty Notion page with a empty database

What is the expected behavior?

No error in the logs and a working create a database Notion MCP tool.

What do you see instead?

When tailing the logs of codex tail -F ~/.codex/log/codex-tui.log at every call you get the following error:

2025-09-21T22:12:53.843020Z ERROR Failed to convert "notion__API-create-a-database" MCP tool to OpenAI tool: Error("invalid type: map, expected a boolean", line: 0, column: 0)

See screenshot for example:

<img width="1600" height="1021" alt="Image" src="https://github.com/user-attachments/assets/d23f0abf-311e-4beb-9aff-0c7993f6b141" />

When trying to ask codex to create a database it then fails. All other Notion tools work (summarize, create a page etc...)

Additional information

_No response_

View original on GitHub ↗

2 Comments

lionelchg contributor · 11 months ago

After some investigation I believe that the schema of that particular tool create-a-database (https://github.com/makenotion/notion-mcp-server/blob/main/scripts/notion-openapi.json) is not handled by codex:

  • In the Notion OpenAPI spec (/v1/databases → POST → requestBody), the properties field in the payload is declared as:
    "properties": {
      "type": "object",
      "description": "...",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "title": { ... }
            },
            "additionalProperties": false,
            "required": ["title"]
          }
        ]
      }
    }
  • That additionalProperties value is itself a schema object (wrapped in a oneOf) so callers can define arbitrary database properties. Our converter doesn’t understand that richer form; it only accepts a bare boolean in codex-rs/core/src/openai_tools.rs -> additional_properties. As soon as serde tries to materialize the schema into JsonSchema::Object, it encounters the object and throws the “expected a boolean” error.

To solve this issue I guess we need to change the schema of the additional_properties field

gpeal contributor · 9 months ago

I just tried this on the latest release and things seem to be working fine now! There have been a lot of MCP changes since this was originally filed.