Skip to main content
Glama

List files

list_files
Read-only

Browse a workspace directory tree to confirm paths exist or inspect files and folders, with adjustable depth, entry limits, and optional ignored folders.

Instructions

List files and directories (depth 1-3, limit up to 200). include_ignored=true also lists ignored folders. Use when: you need the directory tree or want to confirm a path exists. Avoid when: you know the file (read_file) or want what changed lately (recent_files). Output: entries[] {relative_path, kind, size_bytes}, truncated.

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_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoTree depth (default 1, max 3).
limitNoMax entries (default 200, max 200).
relative_pathNoWorkspace-relative ('.' = root); absolute/.. outside it rejected.
include_ignoredNotrue also lists ignored folders (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.5.0
    • removedInput schema / properties / include_ignored / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_ignored / description
      Previous value: -"1 also lists ignored folders (default 0)."New value: +"true also lists ignored folders (default false)."
    • removedInput schema / properties / include_ignored / maximum
      Removed value: -1
    • removedInput schema / properties / include_ignored / minimum
      Removed value: -0
    • changedInput schema / properties / include_ignored / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds behavior beyond that: include_ignored toggles ignored folders, results can be truncated, and the returned entry shape is disclosed. Only pagination/truncation mechanics (how to page further) are unstated.

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?

Four short, labeled segments — capability, use case, exclusion, output — with the primary action front-loaded and zero filler. Each sentence carries a distinct decision-relevant fact.

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

Completeness5/5

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

For a read-only listing tool with no output schema, the description supplies the output field list and the truncation caveat, plus all routing context. An agent has everything needed to call it correctly and interpret the result.

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 100%, so every parameter (depth, limit, relative_path, include_ignored) is already documented including ranges and defaults. The description restates depth/limit bounds and include_ignored semantics without adding new meaning, which is the baseline 3 case.

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

Purpose5/5

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

Specific verb+resource ('List files and directories') with scope qualifiers (depth 1-3, limit up to 200) stated up front, and it names the distinguishing siblings (read_file, recent_files) so an agent can separate it from adjacent tools without opening schemas.

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

Usage Guidelines5/5

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

Explicit 'Use when' and 'Avoid when' clauses, each paired with a named alternative tool and the condition that selects it. Nothing is left to inference about routing.

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