Skip to main content
Glama

list_files

Explore repository contents by listing files and directories with recursive depth control, providing a structured overview with file sizes.

Instructions

List files and directories in the repository.

Args: directory: Relative subfolder inside the repository (empty string for root). recursive: Whether to list recursively through child directories (default: True). max_depth: Maximum directory recursion depth (default: 10).

Returns: JSON string containing total_entries and a structured list of files with sizes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNo
max_depthNo
recursiveNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It clearly states the return type (JSON string), the top-level return fields (total_entries and a structured list), and that files include sizes. It also clarifies recursion defaults. It could mention error behavior or edge cases, but it is transparent about the core behavior.

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?

The description is front-loaded with a concise purpose statement and then organized into compact Args and Returns sections. Every sentence adds necessary information, and there is no filler or repetition.

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 simple three-parameter listing tool with an output schema available, the description is complete: it covers purpose, all parameters with defaults, and the return contract. Nothing critical is missing for an agent to invoke it correctly.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must compensate, and it does. It explains that directory is a relative subfolder with empty string meaning root, that recursive controls traversal into child directories, and that max_depth limits recursion depth. This adds real meaning beyond the bare property names and defaults.

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?

The description states a clear verb-resource pair: 'List files and directories in the repository.' This is specific and naturally distinguishes the tool from siblings like read_file (file content access) and search_code (querying code).

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?

The description provides solid invocation details: the directory argument is relative to the repository root, recursion defaults to true, and max_depth defaults to 10. However, it never explicitly states when to prefer this tool over alternatives or when not to use it, leaving the routing decision mostly implicit.

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