servers icon indicating copy to clipboard operation
servers copied to clipboard

filesystem: tool parameters missing descriptions (agents guess at values)

Open blackwell-systems opened this issue 6 months ago • 4 comments

All 14 tools in the filesystem server define required parameters with no description field in the JSON schema. For example, read_file declares path as a required string but doesn't specify whether it expects a relative path, absolute path, glob pattern, or file URI.

This matters because AI agents use parameter descriptions to decide what values to pass. Without descriptions, agents must infer from the parameter name alone, which leads to incorrect tool calls (wrong path format, missing trailing slashes, etc.).

Affected parameters (16 required params across 14 tools):

Tool Parameter Type
read_file path string
read_text_file path string
read_media_file path string
write_file path, content string
edit_file path, edits string, array
create_directory path string
list_directory path string
list_directory_with_sizes path string
directory_tree path string
move_file source, destination string
search_files path, pattern string
get_file_info path string

Example of what helps agents (from other MCP servers):

{
  "name": "path",
  "type": "string",
  "description": "Absolute path to the file. Must be within the allowed directories."
}

vs what filesystem currently returns:

{
  "name": "path",
  "type": "string"
}

Found via static schema analysis (mcp-assert lint).

blackwell-systems avatar May 03 '26 18:05 blackwell-systems

Same issue affects mcp-server-git and server-memory in this repo:

mcp-server-git (12 tools): 22 errors, 23 warnings. Every parameter in all 12 tools is undescribed. Agents don't know if repo_path is absolute or relative, if ref is a branch name or SHA, if diff_unified is a number or a flag.

server-memory (9 tools): 4 errors, 1 warning. create_entities, create_relations, add_observations, delete_observations all have required parameters with no description.

$ mcp-assert lint --server "uvx mcp-server-git --repository /path/to/repo"
mcp-git: 12 tools, 22 errors, 23 warnings

$ mcp-assert lint --server "npx -y @modelcontextprotocol/server-memory"
memory-server: 9 tools, 4 errors, 1 warning

This is a systemic pattern across the official servers: schemas define parameter types but omit descriptions. The most impactful fix would be adding descriptions to required parameters in the servers that agents use most frequently (filesystem, git, memory).

blackwell-systems avatar May 03 '26 18:05 blackwell-systems

I built mcpeval specifically for catching these kinds of schema issues automatically. It flags missing parameter descriptions, missing enums on categorical fields, and generic param names that cause agents to guess.

$ mcpeval check filesystem_server.json
  Schema Score: 72/100 (C)
  !  read_file    Parameter 'path' has no description
  !  edit_file    Parameter 'dryRun' has no description

Could be useful as a pre-commit hook or CI check to prevent these from shipping.

jashshah999 avatar May 05 '26 05:05 jashshah999

The filesystem server is the textbook case for this because the parameter most likely to be wrong (path`) is also the parameter with the largest blast radius. "agents guess" is the polite version — what actually happens is the model fills the value from the most recent path-shaped string in context, which is sometimes the right one and sometimes a path the user mentioned as something to avoid.

Two patches that move the needle more than just "add a description string":

Path-shaped parameters need shape, not just type. "description": "the file path" is barely better than nothing. The bar that actually disambiguates:

"Absolute POSIX path to a file (not a directory) inside the allowed-directory sandbox. Symlinks pointing outside the sandbox are rejected. Examples: /Users/me/notes.md, /workspace/repo/README.md."

That answers: type, shape, constraint, what-not-to-pass, example.

Mutation-scope parameters need mutation language at the parameter level. edit_file has a dryRun parameter mentioned in another comment — its description has to say what happens when false, because the LLM treats the absence of warning language as permission. Same for write_file's path (writes overwrite by default), and delete-style tools where the path is the entire blast radius.

For automated checking, the existing comments already covered mcp-assert and mcpeval for lint-level catches. If you want a CI gate that runs against the live launch command (so it catches stuff that only manifests after handshake), npx @incultnitostudiosllc/mcp-probe test "<launch command>" outputs a scorecard you can fail a build on. Anthropic's MCP Inspector is still the right tool for interactive exploration. Different stages, all worth running before the next release tag.`

PengSpirit avatar May 09 '26 09:05 PengSpirit

Closing as a duplicate of #3984; let's track it there.

localden avatar Jul 30 '26 00:07 localden