You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_file_contents directory results emit a top-level structuredContent array that object-only clients reject #3864
get_file_contents works for individual files but fails to list directories in an MCP client that requires structuredContent to be an object. The directory path produces a top-level JSON array and advertises that shape in outputSchema; the client rejects the response before exposing the entries.
Reproduction
Using the GitHub MCP Server connector (reported server version 2.1.0), call get_file_contents with owner: "github", repo: "github-mcp-server", path: "/", fields: ["name", "type", "path"]. The same failure also occurs for path: "pkg/github" and path: "internal". Reading a single file such as pkg/github/repository_tool_types.go succeeds.
The directory call fails with:
Upstream call failed on target 'remote': 1 validation error for CallToolResult
structuredContent
Input should be a valid dictionary [type=dict_type, input_value=[{'name': '.dockerignore'...}], input_type=list]
repositoryContentsOutputSchema() in the same file explicitly includes an array variant, reflected by the get_file_contents tool snapshot (outputSchema.oneOf: null, array, object).
This is a specific interoperability failure, distinct from the general request in #1929 to populate structuredContent for tools.
Expected behavior / suggested fix
Directory listings should remain usable by clients that expect an object-valued structuredContent. Wrap the entries in an object, e.g. { "entries": [...] }, and update the advertised output schema and tests accordingly. Preserve the existing text output for compatibility, and add a regression test that exercises a directory listing through an object-valued structured-content consumer.
Impact
Agents using such clients cannot browse repository directories through get_file_contents, even when file reads and code search work.
Activity