Skip to main content
Glama

list_files

Read-onlyIdempotent

Lists source files in the code graph by path with module ID, language and layer; filter by path pattern to find files or review repository contents.

Instructions

Lists the source files the graph holds, sorted by path: one line per file with its module ID, language and architecture layer, then a count. Use it to see what the repository contains, or to find a file by a part of its path: pattern is literal text with optional .* wildcards, matched anywhere in the path (tests/.*pricing); without it every file is listed. Only source files of the supported languages are in the graph. For what one file defines use describe_module; for its text use read_source. A long list stops at 200 items unless all is true.

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
allNoList everything instead of stopping at 200 items.
patternNoPart of a path; literal text with optional .* wildcards. Without it every file is listed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real behavioral context: the exact line format returned, a hard 200-item cap that is bypassed by `all`, and the graph's coverage limit to supported-language source files. It stops short of saying whether a truncated result is flagged as truncated, which is the one operational detail an agent might still need.

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?

Front-loaded with what it does and what it returns, then matching semantics, then sibling routing, then the truncation caveat. Every sentence carries distinct information — scope, output format, matching rules, alternatives, limit — with no filler.

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?

Only two optional parameters and no output schema, yet the description supplies the return shape, the truncation behavior, and the data-coverage boundary. Nothing material is missing for an agent to call this correctly on the first attempt.

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

Parameters4/5

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

Schema coverage is 100%, so baseline would be 3, but the description adds matching semantics: the pattern is literal text with optional `.*` wildcards matched anywhere in the path, illustrated with `tests/.*pricing`, and it states the no-pattern default of listing everything. The `all` flag is tied to the 200-item threshold rather than merely restated.

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?

States a specific verb and resource ('Lists the source files the graph holds') plus the sort order and per-line output shape (module ID, language, layer, then a count). It also scopes the resource ('Only source files of the supported languages are in the graph'), so an agent knows exactly what is listed versus what is not.

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?

Gives two concrete use cases ('see what the repository contains' or 'find a file by a part of its path') and explicitly routes elsewhere: 'For what one file defines use describe_module; for its text use read_source.' That is when-to-use plus named alternatives, leaving little to infer.

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