Skip to main content
Glama
local-context
by JustinA988

list_dir

Read-only

Lists directory entry names within an allowed path, without reading file contents, so you can inspect folder structure and choose files to access.

Instructions

List names in an allowed directory. Does not read file contents.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_dir"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoDirectory. Defaults to the root.
limitNoMax entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnlyHint, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral fact — access is restricted to an "allowed directory" and only names are returned, not contents — but says nothing about ordering, pagination interaction with limit, or behavior on an invalid or disallowed path.

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

Conciseness5/5

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

Two short sentences, zero filler, with the core purpose front-loaded and the disambiguating constraint second. Every clause carries information.

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

Completeness4/5

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

For a simple two-optional-parameter read tool with no output schema, the description is nearly sufficient — "list names" hints at the return shape and the allowed-directory restriction sets expectations. A little more on return format or failure modes would make it complete.

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 coverage is 100%, so both path and limit are already documented with their defaults. The description adds no format, path syntax, or limit semantics beyond that, so baseline 3 applies.

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?

The description gives a specific verb and resource ("List names in an allowed directory") and immediately delimits scope with "Does not read file contents," which implicitly separates it from the read_file sibling. It does not name an alternative explicitly, so it falls just short of a 5.

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: the negative clause about file contents signals this is for discovery/navigation rather than retrieval. There is no explicit when-to-use or when-not-to-use guidance, and nothing routes the agent between list_dir and siblings like list_sources or search_text.

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