openclaw - ✅(Solved) Fix [Bug]: Synology MCP tool calls fail with "params: must be object" — OpenClaw passes params as string [1 pull requests, 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
openclaw/openclaw#70872Fetched 2026-04-24 10:38:28
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×2

When calling Synology MCP tools through OpenClaw's native MCP adapter, all tool calls fail with a validation error:

Validation failed for tool "synology__synology_test_connection":
  - params: must be object

Received arguments:
{
  "params": "{}"
}

The same tools work correctly when called through mcporter (a separate MCP proxy), which passes params as a proper JSON object rather than a string.

Error Message

When calling Synology MCP tools through OpenClaw's native MCP adapter, all tool calls fail with a validation error: 4. Observe the validation error: params: must be object

Root Cause

Root Cause (likely)

Fix Action

Workaround

Call Synology tools via mcporter call 'synology.synology_test_connection' 'params={}' which correctly serializes params as a JSON object.

PR fix notes

PR #70882: fix(bundle-mcp): coerce stringified object/array params before MCP tool calls

Description (problem / solution / changelog)

Summary

LLMs sometimes serialize nested tool parameters as JSON strings (e.g. "params": "{}" instead of "params": {}). Strict MCP servers with Pydantic validation reject the string form, causing params: must be object validation errors.

This adds coerceStringifiedObjectProperties() in the MCP tool materialize layer (pi-bundle-mcp-materialize.ts) that checks each property's inputSchema type and JSON.parse()s string values back to objects/arrays when the schema expects them.

Root Cause

When OpenClaw's native MCP adapter passes tool call arguments to stdio MCP servers, properties declared as type: "object" or type: "array" in the tool's inputSchema may arrive as stringified JSON from the LLM. The MCP server's Pydantic validation rejects "params": "{}" when it expects "params": {}.

Fix

  • Added coerceStringifiedObjectProperties() that iterates over input record entries
  • For each property, checks the corresponding inputSchema property type
  • If the schema expects object/array and the value is a valid JSON string encoding one, parse it back
  • Non-matching values pass through unchanged (safe, no-op for already-correct inputs)

Testing

  • Added 2 new tests to pi-bundle-mcp-tools.materialize.test.ts:
    • Verifies stringified {} and [] are coerced to proper objects/arrays
    • Verifies already-correct object params pass through unchanged
  • All 6 tests pass ✅

Impact

Fixes all MCP servers that use type: "object" params with strict validation (Pydantic, Zod, etc.), not just Synology.

Fixes #70872

Changed files

  • src/agents/pi-bundle-mcp-materialize.ts (modified, +62/-1)
  • src/agents/pi-bundle-mcp-tools.materialize.test.ts (modified, +112/-0)

Code Example

Validation failed for tool "synology__synology_test_connection":
  - params: must be object

Received arguments:
{
  "params": "{}"
}

---

{
  "synology": {
    "command": "/home/moltbot/repositories/dk-synology-mcp/.venv/bin/synology-mcp",
    "args": [],
    "description": "Synology NAS management"
  }
}
RAW_BUFFERClick to expand / collapse

Summary

When calling Synology MCP tools through OpenClaw's native MCP adapter, all tool calls fail with a validation error:

Validation failed for tool "synology__synology_test_connection":
  - params: must be object

Received arguments:
{
  "params": "{}"
}

The same tools work correctly when called through mcporter (a separate MCP proxy), which passes params as a proper JSON object rather than a string.

Environment

  • OpenClaw version: 2026.4.21 (f788c88)
  • Synology MCP server: dk-synology-mcp (local binary, stdio transport)
  • OS: Linux 6.8.0-107-generic (x64)
  • Config:
{
  "synology": {
    "command": "/home/moltbot/repositories/dk-synology-mcp/.venv/bin/synology-mcp",
    "args": [],
    "description": "Synology NAS management"
  }
}

Reproduction

  1. Configure Synology MCP server in openclaw.json as a stdio MCP server
  2. Restart gateway
  3. Call any synology__* tool, e.g. synology__synology_test_connection with params: {}
  4. Observe the validation error: params: must be object

Expected Behavior

Tool calls should pass params as a JSON object, not a string. The Synology MCP server's Pydantic schema expects params to be an object type, not a string.

Workaround

Call Synology tools via mcporter call 'synology.synology_test_connection' 'params={}' which correctly serializes params as a JSON object.

Root Cause (likely)

OpenClaw's MCP tool adapter appears to serialize tool call arguments as strings rather than preserving their JSON object type when passing them to stdio MCP servers. The Pydantic validation in the Synology MCP server rejects the string "{}" when it expects a dict/object {}.

This may be related to how OpenClaw's tool adapter handles inputSchema properties with type: "object" — the adapter may be stringifying the entire params value instead of preserving its structure.

Impact

All Synology MCP tools are unusable through OpenClaw's native adapter. This likely affects other MCP servers that use type: "object" params with Pydantic validation.

Related

  • #61863, #68772, #70196 — Different issue (JSON Schema draft-2020-12 validation), but also affects MCP tool calls

extent analysis

TL;DR

The most likely fix is to modify OpenClaw's MCP tool adapter to preserve the JSON object type of tool call arguments instead of serializing them as strings.

Guidance

  • Verify that the issue is indeed caused by the serialization of tool call arguments as strings by checking the OpenClaw's MCP tool adapter code.
  • Investigate how the inputSchema properties with type: "object" are handled in the adapter and modify the code to preserve the object structure.
  • Test the modified adapter with the Synology MCP server to ensure that the params are passed as a JSON object.
  • Consider updating the OpenClaw documentation to reflect the correct usage of params with MCP servers that use Pydantic validation.

Example

No code snippet is provided as the issue does not contain enough information about the OpenClaw's MCP tool adapter implementation.

Notes

The provided workaround using mcporter suggests that the issue is specific to OpenClaw's native MCP adapter. The root cause analysis points to a potential issue with how the adapter handles inputSchema properties with type: "object".

Recommendation

Apply workaround: use mcporter to call Synology tools until the OpenClaw's MCP tool adapter is modified to correctly handle JSON object type arguments. This is because the workaround is already proven to work and allows for continued usage of the Synology MCP tools while the adapter issue is being addressed.

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