Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
An MCP tool call where an optional string argument is set to JSON null fails with a
server-side error via OpenClaw, while the identical call (same arguments, same server URL
and token) sent from another MCP client (Cursor) succeeds — indicating OpenClaw transmits
the optional null argument differently.
Steps to reproduce
- Configure an MCP server over streamable-http that exposes a tool with an OPTIONAL string
argument whose JSON Schema is anyOf [string, null] with default null
(concrete case: awslabs eks-mcp-serverget_eks_insights, arginsight_id). - Have the agent call the tool in "list" mode, i.e. with insight_id = null.
- Observe the tool result is the server's "describe one item" error path, and the
OpenClaw trajectory records the arguments with insight_id: null. - Send the identical arguments from another MCP client (Cursor) to the same server URL +
bearer token -> it returns the list successfully.
Expected behavior
Calling the tool with the optional argument = null (or absent) should behave as "not
provided". Grounded reference: the identical arguments sent from another MCP client (Cursor)
to the same server return the list successfully, and the tool's JSON Schema defines null as
the default ("no id" => list mode).
Actual behavior
The call fails. OpenClaw trajectory recorded the tool arguments as:
{"category":null,"cluster_name":"testenv-cluster","insight_id":null}
and the tool returned:
Error retrieving insight details: An error occurred (AccessDeniedException) when calling
the DescribeInsight operation: Unable to determine service/operation name to be authorized
Against that same server, this error is reproducible ONLY when insight_id is sent as an
empty string "" — sending null, absent, or the string "null" all return the list. So the
server distinguishes "" from null, and OpenClaw's null call behaves like "".
OpenClaw version
2026.6.10 (aa69b12)
Operating system
Ubuntu Linux (kernel 7.0.0-1006-aws), x86_64 EC2
Install method
npm global (~/.npm-global)
Model
gpt-5.5
Provider / routing chain
openclaw -> gateway -> gpt-5.5
Additional provider/model setup details
MCP path relevant to this bug: openclaw -> mcphub (streamable-http) -> awslabs eks-mcp-server.
Logs, screenshots, and evidence
# OpenClaw trajectory: tool call arguments (insight_id is null) and the error result
get_eks_insights","arguments":{"category":null,"cluster_name":"testenv-cluster","insight_id":null}
get_eks_insights","content":[{"type":"text","text":"Error retrieving insight details: An error occurred (AccessDeniedException) when calling the DescribeInsight operation: Unable to determine service/operation name to be authorized"}],"details":{"mcpServer":"mcphub","mcpTool":"eks-apn1-get_eks_insights","status":"error"}
# Same server, same token, sent from another MCP client (Cursor):
# {cluster_name} -> list OK
# {cluster_name, insight_id: null} -> list OK
# {cluster_name, insight_id: "null"} -> list OK
# {cluster_name, insight_id: ""} -> SAME DescribeInsight error as aboveImpact and severity
Affected: any MCP server that distinguishes null/absent from "" for an optional argument.
Severity: High for affected tools (the "list" form of get_eks_insights is impossible from
OpenClaw; it always errors).
Frequency: Always (reproduced repeatedly, including a forced single-call test).
Consequence: A logically valid tool call is unusable via OpenClaw while working from other
MCP clients.
Additional information
Hypothesis (NOT yet confirmed by a captured wire payload): OpenClaw may serialize optional
arguments set to JSON null as empty strings "" when calling MCP tools over streamable-http.
We could not capture the raw wire request: openclaw proxy run blocked the model provider
endpoint via SSRF protection, so the run could not reach the MCP call under capture.
Downstream defensive fix filed at awslabs/mcp#4036 (server side treating "" as list mode),
but the originating behavior appears to be on the OpenClaw client side.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 25, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 25, 2026, 5:08 AM ET / 09:08 UTC.
Summary
Keep open: current main and the latest release still forward MCP tool input records without dropping null values, and the unmerged linked PR is the active candidate fix rather than an implemented solution.
Reproducibility: yes. with medium confidence from source and reporter evidence: the reported release and current main both forward null-containing input records through the bundle-MCP call path. I did not run the awslabs EKS MCP server or capture a live wire payload.
Root-cause cluster
Relationship:
canonicalCanonical: #96716
Summary: This issue is the canonical report for the optional-null MCP argument behavior, with one open candidate fix PR.
Members:
fixed_by_candidate: fix(mcp): strip null optional arguments before MCP tool calls #96718 - The PR uses closing syntax for this issue and changes the MCP tool-call dispatch boundary.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
An open linked PR already owns the implementation path, so this issue should not queue a separate repair job unless that PR is closed or rejected.
Review details
Best possible solution:
Keep this issue open while maintainers review the linked candidate fix; the final fix should normalize optional-null MCP arguments at the bundle-MCP boundary with focused regression coverage and avoid changing meaningful required-null parameters.
Do we have a high-confidence way to reproduce the issue?
Yes, with medium confidence from source and reporter evidence: the reported release and current main both forward null-containing input records through the bundle-MCP call path. I did not run the awslabs EKS MCP server or capture a live wire payload.
Is this the best way to solve the issue?
Unclear until the linked PR is reviewed: stripping optional nulls before MCP dispatch is a plausible narrow fix, but a schema-aware version may be safer than dropping every top-level null value.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against c8c4490b1729.
Label changes
Label changes:
P2: This is a normal-priority MCP runtime bug with a clear affected tool-call path and limited blast radius.impact:other: The issue affects external MCP tool invocation semantics, which is maintainer-visible but outside the more specific impact label taxonomy.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.Label justifications:
P2: This is a normal-priority MCP runtime bug with a clear affected tool-call path and limited blast radius.impact:other: The issue affects external MCP tool invocation semantics, which is maintainer-visible but outside the more specific impact label taxonomy.Evidence reviewed
What I checked:
runtime.callTool(...); there is no current-main null stripping at this boundary. (src/agents/agent-bundle-mcp-materialize.ts:406, c8c4490b1729)argumentsto the MCP SDK call, so a record containing null values remains in the tool-call argument object at this layer. (src/agents/agent-bundle-mcp-runtime.ts:902, c8c4490b1729)v2026.6.10shows the same dispatch line passinginputdirectly toruntime.callTool(...), matching the version reported by the issue. (src/agents/agent-bundle-mcp-materialize.ts:406, aa69b12d0086)070996e5c3, which introduced the relevant current-main forwarding behavior. (src/agents/agent-bundle-mcp-materialize.ts:406, 070996e5c334)argumentsas a record of unknown values andClient.callToolsends the supplied params throughtools/call; this supports reviewing null handling at the OpenClaw boundary rather than assuming the SDK contract rejects null values. (package.json:1965)Likely related people:
git blameandgit show --stattie the current materialization and runtime files to commit070996e5c3, which introduced the directinputtocallToolpath. (role: introduced current bundle-MCP forwarding path; confidence: medium; commits: 070996e5c334; files:src/agents/agent-bundle-mcp-materialize.ts,src/agents/agent-bundle-mcp-runtime.ts)src/agents/agent-bundle-mcp-materialize.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(mcp): schema-aware null stripping for MCP tool calls
fix(validation): preserve null in anyOf unions instead of coercing to…
fix(validation): preserve null in anyOf unions instead of coercing to…
fix(validation): preserve null in anyOf unions instead of coercing to…
fix(validation): preserve null in anyOf unions instead of coercing to…
VACInc commentedon Sep 6, 2026
Related shared-validator follow-up: #140310 merged as b494b1f.
The new regression coverage preserves genuine null values while preventing rejected non-null inputs from being converted into null as a validation fallback. It covers tagged TypeBox and plain nullable unions while retaining supported record, numeric-enum, and integer conversion behavior.
This is related validation hardening, not a claim that #140310 originally fixed this issue or that its EKS MCP scenario was rerun. This report concerns genuine null becoming an empty string; the newly guarded case concerns invalid non-null input becoming null.
The issue's existing closed state is unchanged.
Exact TypeBox 1.3.18 source inspection and executed probe: #140310 (comment)