Skip to main content
Glama

list_directory

Read-onlyIdempotent

Lists files and folders in an absolute local directory so AI assistants can inspect project contents, with an optional result limit for controlled browsing.

Instructions

List entries in an absolute local directory.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "list_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
limitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile needs no restating. The description does add one behavioral constraint not present anywhere else: the path must be absolute, which affects how a call will fail. It says nothing about recursion depth, hidden files, ordering, or what happens when the limit is hit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler, and the absolute-path constraint is packed into the core statement. It is efficient, though the brevity leaves obvious gaps rather than being optimally sized for a two-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and annotations carry the safety profile, and there is no output schema to explain. Still, an agent cannot tell from this description whether listing is recursive, what an entry contains, or how the limit interacts with results, which is meaningful for a directory-listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description does compensate for the more consequential parameter by stating that 'path' must be absolute. The 'limit' parameter (default 500, max 2000) gets no explanation at all – whether it truncates results, and whether truncation is signaled, is left unknown.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('List entries') plus a scope constraint ('absolute local directory'), which is enough to separate it from read_file, file_info, and list_drives. It stops short of naming or contrasting any sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by the phrase 'absolute local directory' – the agent can infer it should be used for browsing a known directory rather than reading a file. There is no statement of when not to use it, nor any pointer to read_file or file_info for related needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.