Skip to content

Notion number property write rejected via gateway MCP connection; identical call succeeds via separate local MCP session #107648

Closed as not planned

Description

@Almeida-FilhoDG

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The Notion MCP connection used by the OpenClaw gateway agent rejects valid numeric ("number" type) property values when creating or updating a database page, while an identical tool call issued from a separate local MCP session succeeds.

Steps to reproduce

  1. Configure the official remote Notion MCP connector (HTTP transport, OAuth) and connect it both to an OpenClaw gateway agent session and to a separate local MCP client session, using the same integration and the same database.
  2. In a Notion database with a property of type "number", have the gateway agent call the page create/update tool with a valid parent (data source id) and a plain JSON number for that property (e.g. 10).
  3. Observe the error returned by the tool call: Invalid number value for property <property>: <value>. Number values must be JavaScript numbers.
  4. From the separate local MCP session (same integration, same database), issue the exact same call (same parent, same property name, same JS number value). Observe it succeeds.

Expected behavior

The identical tool call (same parent/data source id, same property, same JS number value) that succeeds via a local MCP session should also succeed when issued by the gateway agent.

Actual behavior

The gateway agent's call is rejected by the Notion API with "Invalid number value for property Volume (ml): 10. Number values must be JavaScript numbers." Reproduced 3 times in the same turn using different value encodings (plain JSON number, string "10", and via a follow-up update_properties call on an existing page) — all failed identically. The same value, same property, same parent, succeeded when sent via a separate local MCP session.

OpenClaw version

2026.6.11, reproduced again after upgrading to 2026.7.1 (gateway restarted and verified after the upgrade)

Operating system

Windows 10 Pro, build 10.0.19045

Install method

npm global

Model

anthropic/claude-haiku-4-5

Provider / routing chain

openclaw gateway agent -> anthropic (direct, anthropic-messages API) — no intermediate proxy observed in the session transcript.

Additional provider/model setup details

NOT_ENOUGH_INFO

Logs

Failing call (gateway agent session), 1st attempt:
tool: notion-create-pages
args: {"parent":{"type":"data_source_id","data_source_id":"<data_source_id>"},"pages":[{"properties":{"Registro":"...","Tipo":"...","Volume (ml)":10,"date:Quando:start":"2026-07-13T23:04:35","date:Quando:is_datetime":1}}]}
result (error): {"name":"APIResponseError","code":"validation_error","status":400,"body":"{\"message\":\"Invalid number value for property Volume (ml): 10. Number values must be JavaScript numbers.\"}"}

2nd attempt, same value as a string "10": identical error message.

3rd attempt, via notion-update-page / update_properties on an existing page, same value 10: identical error message.

Control test: the exact same parent/property/value, called from a separate local MCP session (not the gateway), succeeded and returned the created page with the property correctly set to 10.

Screenshots, recordings, and evidence

No screenshots; evidence is the raw session transcript (.jsonl) showing the tool call arguments and error responses quoted above.

Impact and severity

Affected: any user relying on the gateway agent to write "number"-type properties via the official Notion MCP connector.
Severity: Blocks workflow for structured numeric data — the page is either not created, created without the numeric property set, or (if other properties are set first) left permanently missing that value.
Frequency: Always, in the observed session (3/3 attempts with varied value encodings failed identically; reproduced again after upgrading OpenClaw).
Consequence: Numeric data cannot be reliably recorded through the gateway agent; requires a manual workaround from a separate local MCP session to backfill the value.

Additional information

Confirmed bad on both 2026.6.11 and 2026.7.1. No known-good version identified (not tested on earlier versions). Temporary workaround: perform the same page create/update call from a local, non-gateway MCP session instead of the in-gateway agent session.

Activity

  1. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    on Jul 15, 2026
  2. clawsweeper commented on Jul 15, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: the reporter established failures on official releases, while the merged union-preservation repair has not been verified against the reported Gateway-to-Notion workflow.

    Reproducibility: The reporter supplies concrete official-release failures, but no high-confidence current-main reproduction is established; this read-only review executed no runtime tests or Notion calls.

    Next step
    Verify Notion numeric create/update calls on a Gateway containing the union repair and capture sanitized schemas and outbound argument types if rejection persists.

    Review details

    Best possible solution:

    Confirm the repaired Gateway preserves numeric properties through successful Notion create and update calls, then repair only any demonstrated remaining conversion boundary.

    Do we have a high-confidence way to reproduce the issue?

    The reporter supplies concrete official-release failures, but no high-confidence current-main reproduction is established; this read-only review executed no runtime tests or Notion calls.

    Is this the best way to solve the issue?

    The merged shared-validator repair addresses a plausible mechanism; another MCP-specific coercion layer would be premature without a failing post-repair call and its actual schema.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No post-repair Notion create/update result or exact advertised and normalized schemas establish whether the remaining failure belongs to OpenClaw validation or the remote service/session.

    Codex review notes: model internal, reasoning medium; reviewed against e3da7af76e91.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: The reported numeric-write failure blocks a bounded integration workflow with a separate-client workaround.
    • impact:other: Rejected Notion MCP writes disrupt structured-data recording without demonstrated OpenClaw data loss.
    Evidence reviewed

    Acceptance criteria:

    • Confirm the tested revision contains e491bbc.
    • Compare authorized Gateway and local Notion create and update calls with identical JSON numeric values.
    • If rejection persists, compare advertised and normalized schemas with sanitized post-validation outbound argument types.
    • Before opening a repair PR, establish a failing regression at the proven owner and rerun the same product flow with the fix.

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 23, 2026, 12:10 PM ET / 16:10 UTC.

  3. added
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jul 15, 2026
  4. added a commit that references this issue on Jul 27, 2026
    eae9e93
  5. openclaw-barnacle commented on Jul 30, 2026

    @openclaw-barnacle

    This bug report has been automatically marked as stale due to inactivity.
    ClawSweeper is checking whether current main already fixes the reported behavior.
    Inactivity alone will not close a bug report.

  6. added
    staleMarked as stale due to inactivity
    and removed
    staleMarked as stale due to inactivity
    on Jul 30, 2026
  7. Almeida-FilhoDG commented on Aug 11, 2026

    @Almeida-FilhoDG
    Author

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 7, 2026, 1:32 PM ET / 17:32 UTC.

    Summary Keep open: current source contains a plausible schema-driven number-to-string conversion before the final MCP call, while the linked closed PR addressed only the wrong string-to-number theory. A redacted side-by-side schema and wire capture is needed before a safe repair can be chosen.

    Reproducibility: unclear. source establishes a plausible validation conversion and the final call boundary, but no current-main Notion schema or redacted gateway/local wire comparison proves which boundary changes the value.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Maintainer decision needed

    Question Recommendation
    Should this issue first request a redacted comparison of the live Notion tool schema and gateway/local MCP tools/call payloads before any OpenClaw repair is attempted? Request boundary evidence: Ask for the advertised inputSchema and redacted post-validation gateway and local request/response traces, then choose the owner from the observed type drift.
    Why: Current code supports two materially different outcomes: schema validation may stringify a dynamic property, or equivalent outbound requests may expose an external Notion MCP session difference.

    Next step A maintainer-led request for type-sensitive boundary evidence is needed before a repair worker can safely identify the responsible layer.

    Review details
    Best possible solution:

    Capture the Notion tools/list schema and redacted post-validation gateway and local tools/call payloads, then repair only the proven schema-validation or transport owner; if the requests match, route the remaining behavior to the Notion MCP service/session boundary.

    Do we have a high-confidence way to reproduce the issue?

    Unclear; source establishes a plausible validation conversion and the final call boundary, but no current-main Notion schema or redacted gateway/local wire comparison proves which boundary changes the value.

    Is this the best way to solve the issue?

    No; the closed string-only proposal was not the best fix because it did not test the reported plain-number path. The narrowest safe solution follows a capture of the live schema and final request types.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Without the advertised Notion input schema and a post-validation tools/call capture, a global coercion change could corrupt valid arguments for other MCP tools or leave the actual Notion-session divergence unchanged.

    Codex review notes: model internal, reasoning high; reviewed against ab4761f3fc9a.

    Label changes
    Label changes:

    • add issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.
    • add clawsweeper:needs-info: Current issue advisory state selects this label.
    • remove issue-rating: 🦪 silver shellfish: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: The reported behavior repeatedly blocks gateway-driven structured numeric writes for the affected workflow.
    • impact:other: The concrete impact is failed third-party MCP tool execution, outside the more specific owned impact classes.

    Evidence reviewed
    What I checked:

    Likely related people:

    • steipete: Current MCP materialization and validation lines blame to Peter Steinberger’s recent agent-area commit; older provenance was unavailable in the partial checkout. (role: recent agent-runtime contributor; confidence: medium; commits: 8a6e1c30f92a, f4387b7a5eff; files: src/agents/agent-bundle-mcp-materialize.ts, src/agents/agent-bundle-mcp-runtime.ts, packages/llm-core/src/validation.ts)

    How this review workflow works


    Reproduced fresh, side by side, same session, same property (Volume (ml), type number), same data source — one call via a local (non-gateway) MCP session, one via the OpenClaw gateway agent, seconds apart.

    Schema contract (both sides declare the same thing): the notion-create-pages tool schema exposed to both the local session and the gateway agent types property values as string | number | string[] | null — a plain JSON number is an explicitly valid value on both sides.

    Local MCP session (not the gateway) — succeeds:

    call: notion-create-pages
    args: {"parent":{"type":"data_source_id","data_source_id":"<redacted>"},
           "pages":[{"properties":{"Registro":"<redacted>","Tipo":"Outro",
           "Volume (ml)":1,"Quando":"2026-08-10"}}]}
    result: success — page created, "Volume (ml)":1 stored correctly as a number.
    

    OpenClaw gateway agent session — fails, reproduced twice in a row, identical error both times:

    call: notion__notion-create-pages
    args: {"parent":{"type":"data_source_id","data_source_id":"<redacted>"},
           "pages":[{"properties":{"Tipo":"Outro","Volume (ml)":2,
           "Registro":"<redacted>","date:Quando:start":"2026-08-10",
           "date:Quando:is_datetime":0}}]}
    result (error), attempt 1:
    {"object":"error","status":400,"code":"validation_error",
     "message":"Invalid number value for property Volume (ml): 2. Number values must be JavaScript numbers.",
     "request_id":"<redacted>"}
    result (error), attempt 2, identical args, new request_id: same message.
    

    Both "Volume (ml)" values above are genuine JSON numbers in the tool-call arguments (2, not "2") — confirmed by inspecting the raw session transcript, not just the agent's paraphrase of it. The gateway path rejects a value it itself declared as valid, while the same value/property/data source succeeds through a local session moments apart. This is consistent with the earlier "keep open" review note about a possible schema-driven number-to-string conversion happening somewhere between the tool-call arguments and the actual outbound MCP/API call on the gateway path specifically — we were not able to capture raw wire-level (HTTP body) bytes past that point (no per-call verbose/debug logging option found for individual MCP tool calls in the current OpenClaw docs/CLI), so this evidence is at the tool-call/tool-result boundary, same granularity as the original report, but now captured as a true side-by-side (same test session, same minute, same property/value shape) rather than at separate times.

    Happy to run further targeted reproductions (e.g. with debug/verbose flags, if a maintainer can point to one that logs the actual outbound MCP request body) if that would help narrow this down further.

  8. 13 remaining items

  9. added
    P2Normal backlog priority with limited blast radius.
    and removed
    P1High-priority user-facing bug, regression, or broken workflow.
    on Sep 17, 2026
  10. removed
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Oct 9, 2026
  11. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Oct 16, 2026
  12. openclaw-barnacle commented on Oct 23, 2026

    @openclaw-barnacle

    This bug report has had no qualifying human activity for 30 days. Please retest on the current release and share the result.
    Without new human activity, Barnacle may close it as not planned 14 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
    A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

  13. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Oct 23, 2026
  14. steipete commented on Oct 24, 2026

    @steipete
    Contributor

    Thanks for filing this. We're closing older issues that no longer look actionable on current main.

    A schema-preserving fix for numeric MCP tool arguments has landed since this report, and we could not confirm the Notion number write still fails on current main. If it still happens on a recent release, please open a fresh issue with the version and the exact tool call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions