AE Agent Errors
AE-HV7EDV39

Filesystem MCP server returns structuredContent that violates its own outputSchema, so the coding agent's MCP client rejects directory_tree results

INTEGRATION FAILUREseverity: MEDIUMcause: VERIFIEDoutcome: RESOLVED UNVERIFIEDconfidence: HIGH

The filesystem MCP server's directory_tree (and move_file, list_directory_with_sizes) tools returned structuredContent.content as an array of content blocks while their outputSchema declared a string. Claude Code's MCP client validated the output and failed the tool call with MCP error -32602.

Framework / agent
MCP filesystem server · coding agent (Claude Code) using an MCP server
Remediation attempts
TESTED
Recurrence
not documented
Source languages
en
Updated
2026-09-30

Sources

Public sample: the full evidence record is free.

Symptoms

  • Calling directory_tree from Claude Code fails with an output validation error REPORTED CLAIM

Error messages (verbatim)

MCP error -32602: Output validation error: Invalid structured content for tool directory_tree
Invalid input: expected string, received array

Context and trigger

Agent type
coding agent (Claude Code) using an MCP server
Component
@modelcontextprotocol/server-filesystem directory_tree, move_file, list_directory_with_sizes
Framework
MCP filesystem server (2025.11.25 (also 2025.8.21, 2025.7.29, 2025.1.14))
Model
not stated
Task
file system exploration by a coding agent
Tools
directory_tree, move_file, list_directory_with_sizes
  • An MCP client that validates structuredContent against outputSchema calls directory_tree REPORTED CLAIM

Root cause VERIFIED

The tools returned structuredContent: { content: [contentBlock] } while outputSchema declares content as a string, so schema validation failed.

cause stated by the project and addressed by an applied fix

These three tools were returning `structuredContent: { content: [contentBlock] }` (array) but their `outputSchema` declares `{ content: z.string() }`. This mismatch caused schema validation to fail.maintainer · github.com/modelcontextprotocol/servers

Remediation attempts (1)

TESTEDschema_fixby maintainer

Return structuredContent.content as a string matching the declared outputSchema; merged with integration tests for schema compliance.

Status basis: fix merged; regression test changed in the fix. Verification: regression test added with the fix; no independent confirmation that the original failure is gone.

Change: https://github.com/modelcontextprotocol/servers/pull/3113 · merged · tests changed

Changed `structuredContent` from `{ content: [contentBlock] }` to `{ content: text }` to match the declared `outputSchema`maintainer · github.com/modelcontextprotocol/servers
Manually tested `directory_tree` tool in Claude Code - no validation errormaintainer · github.com/modelcontextprotocol/servers

Outcome outcome: RESOLVED UNVERIFIED

fix with regression test; no independent confirmation (2025-12-08)

Recurrence

Not documented in the sources (absence of reports is not evidence of absence).

Confidence HIGH

Root cause stated by the project, a fix was applied, and it is backed by a regression test or independent confirmation.

FactorPresentMeaning
first_party_evidenceyesa quote from the affected project/vendor (or a controlled test)
fix_appliedyesa fix was merged/released
regression_testyestests changed with the fix
independent_confirmationnoreporter/maintainer/vendor confirmed the failure is gone
root_cause_verifiedyescause stated by the project and addressed by the fix
reproduction_documentednosteps or conditions to reproduce were quoted
multiple_independent_sourcesno1 independent source group(s)
failed_attempts_documentednounsuccessful remediation recorded

All evidence (6 verified quotes)

MCP error -32602: Output validation error: Invalid structured content for tool directory_treereporter · github.com/modelcontextprotocol/servers
"message": "Invalid input: expected string, received array"reporter · github.com/modelcontextprotocol/servers
The `directory_tree` tool returns structured content (array of content blocks) while Claude Code's MCP client expects a plain string for the `content` field.reporter · github.com/modelcontextprotocol/servers
These three tools were returning `structuredContent: { content: [contentBlock] }` (array) but their `outputSchema` declares `{ content: z.string() }`. This mismatch caused schema validation to fail.maintainer · github.com/modelcontextprotocol/servers
Manually tested `directory_tree` tool in Claude Code - no validation errormaintainer · github.com/modelcontextprotocol/servers
Changed `structuredContent` from `{ content: [contentBlock] }` to `{ content: text }` to match the declared `outputSchema`maintainer · github.com/modelcontextprotocol/servers

Evidence-gate notes

  • attempt 1: confirmation written by the fix author is not independent; ignored
  • attempt 1: claimed VERIFIED_SUCCESS, evidence allows TESTED

Categories: INTEGRATION FAILURE TOOL FAILUREDATA FAILURE · extraction curated, gate-2026-09-29-v1

Similarity to your system is not implied. A remediation that worked in the documented context may not work in yours.