MCP structuredContent validation appears to check the whole CallToolResult envelope instead of structuredContent only
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When an MCP server declares an outputSchema (via @cyanheads/mcp-ts-core's tool() builder), every tool call to that server fails with a JSON Schema validation error. The error message consistently claims that the declared output fields are all "missing" while also complaining about "additional properties". After reviewing the server's source, structuredContent itself correctly matches the declared schema, so it looks like Claude Code is not extracting structuredContent, but instead validating the entire CallToolResult envelope { content, structuredContent, isError } against the schema.
What Should Happen?
Tool calls to MCP servers that declare an outputSchema should succeed as long as result.structuredContent matches that schema, regardless of sibling fields such as content or isError.
Error Messages/Logs
Calling obsidian_list_tags with no arguments returns:
Error: MCP error -32602: Structured content does not match the tool's output schema: data must have required property 'tags', data must NOT have additional properties
The same error pattern occurs on every other tool, each time citing the tool's own declared output fields as "missing" while rejecting "additional properties":
obsidian_get_note / obsidian_search_notes:
data must have required property 'result', data must NOT have additional properties
obsidian_list_notes:
data must have required property 'path', 'entries', 'totals', 'appliedFilters', data must NOT have additional properties
obsidian_write_note:
data must have required property 'path', 'sectionTargeted', 'created', 'previousSizeInBytes', 'currentSizeInBytes', data must NOT have additional properties
Steps to Reproduce
- Add the following to mcpServers in ~/.claude.json:
"mcp-obsidian": {
"type": "stdio",
"command": "npx",
"args": ["-y", "obsidian-mcp-server@latest"],
"env": {
"OBSIDIAN_API_KEY": "...",
"OBSIDIAN_BASE_URL": "https://127.0.0.1:27124",
"OBSIDIAN_VERIFY_SSL": "false"
}
}
(This server uses @cyanheads/mcp-ts-core and declares an outputSchema in tools/list)
- Call any tool, e.g. obsidian_list_tags, with no arguments
- A structured content validation error is returned (see Error Messages/Logs above for details)
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.206 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Investigation:
I reviewed the source of obsidian-mcp-server v3.2.9 (toolHandlerFactory.js). buildToolSuccessResult correctly assembles a standard { structuredContent, content } result per the MCP spec, and structuredContent itself matches the outputSchema advertised in tools/list (effectiveOutputSchema = output.extend(enrichment)). I could not find any inconsistency on the server side.
Confirmed:
・Updating the Obsidian Local REST API plugin to the latest version (4.1.3) did not resolve this
・obsidian-mcp-server@latest resolves to the current npm latest (3.2.9), so this isn't a stale npx cache issue
・Pinning to the v2 line (2.0.7) would avoid using the outputSchema feature entirely, but this changes every tool name and drops several v3 features (list_tags, document-map, patch_note, Dataview/JSONLogic search), so it's undesirable as a permanent fix
Related issues (not duplicates, but known issues in the same area):
・#4427 — structuredContent is ignored (closed, not planned)
・#25081 — tools disappear from the tool list when a server declares outputSchema (closed, not planned)
・#41361 — regression in 2.1.88 where MCP results stop displaying on outputSchema validation failure (version-specific)
・#14465 — outputSchema is declared but structuredContent is returned as null
・#59480 — when an MCP server returns both content and structuredContent, Claude Code ignores content and only passes structuredContent to the model (closed as duplicate). This differs from the current issue: #59480 silently drops content with no error, whereas here the tool call itself fails outright with an explicit validation error (-32602).
Taken together with these past issues, handling around outputSchema/structuredContent appears to be an area with recurring problems.