-
Notifications
You must be signed in to change notification settings - Fork 9k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
the outputSchema type of the directory_tree tool is incorrect
To Reproduce
call the directory_tree tool in the client
Expected behavior
return the correct information
Logs
meta=None content=[TextContent(type='text', text='MCP error -32602: Output validation error: Invalid structured content for tool directory_tree: [\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "content"\n ],\n "message": "Invalid input: expected string, received array"\n }\n]', annotations=None, meta=None)] structuredContent=None isError=True
Additional context
server.registerTool("directory_tree", {
...
outputSchema: {
content: z.array(z.object({
type: z.string(),
text: z.string()
}))
},
...
after making the above modifications in ./@modelcontextprotocol/server-filesystem/dist/index.js, the returned data is correct
correct logs:
[
{
"name": "kafka",
"type": "directory",
"children": [
{
"name": "mykafka",
"type": "directory",
"children": [
{
"name": ".git",
"type": "directory",
"children": [
{
"name": "COMMIT_EDITMSG",
"type": "file"
},
{
"name": "FETCH_HEAD",
"type": "file"
},
{
"name": "HEAD",
"type": "file"
},
{
"name": "branches",
"type": "directory",
"children": []
},
...
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working