Skip to main content
Glama
Search Code MCP

Search Code MCP

by joutvhu

List Files

list_files
Read-onlyIdempotent

Enumerate files by glob pattern or type without reading contents; respects .gitignore and excludes hidden files by default.

Instructions

Fast file enumeration matching glob patterns or file types without scanning file contents. Respects .gitignore and excludes hidden files by default.

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
pathNoDirectory to list files in (relative or absolute; default: '.')..
noIgnoreNoIf true, include files ignored by .gitignore. Default: false.
filePatternNoGlob pattern to include, e.g. '*.{ts,tsx}' or '**/*.config.js'.
includeHiddenNoIf true, include hidden dotfiles and dot-directories (excludes .git by default). Default: false.
excludePatternNoComma-separated glob patterns to exclude, e.g. '**/dist/**,**/*.test.ts'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.1.0
    • changedInput schema / properties / excludePattern / description
      Previous value: -"Glob pattern to exclude"New value: +"Comma-separated glob patterns to exclude, e.g. '**/dist/**,**/*.test.ts'."
    • changedInput schema / properties / filePattern / description
      Previous value: -"Glob pattern to filter files"New value: +"Glob pattern to include, e.g. '*.{ts,tsx}' or '**/*.config.js'."
    • removedInput schema / properties / fileType
      Removed value: -{
      -  "description": "File type filter",
      -  "type": "string"
      -}
    • changedInput schema / properties / includeHidden / description
      Previous value: -"Include hidden files and directories"New value: +"If true, include hidden dotfiles and dot-directories (excludes .git by default). Default: false."
    • changedInput schema / properties / noIgnore / description
      Previous value: -"Whether to list gitignored files"New value: +"If true, include files ignored by .gitignore. Default: false."
    • changedInput schema / properties / path / description
      Previous value: -"Directory to list files in. Accepts relative or absolute paths (default: '.')"New value: +"Directory to list files in (relative or absolute; default: '.')."
  2. Changed1 schema field changedv1.0.2
    • changedInput schema / properties / path / description
      Previous value: -"Directory to list files in (default: '.')"New value: +"Directory to list files in. Accepts relative or absolute paths (default: '.')"
  3. First observedv1.0.0

TDQS

A4/5.0
Behavior4/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 is covered. The description adds genuinely new behavioral context: it does not read file contents (implying speed), it honors .gitignore, and it excludes hidden files unless overridden. It does not state whether traversal is recursive by default, which is the main remaining behavioral unknown.

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 tightly written sentences, with the core capability front-loaded and the default-behavior caveats following. Every clause carries information an agent needs; nothing is redundant.

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 zero-required-parameter listing tool with full schema coverage and no output schema, the definition covers purpose, performance character, and the two surprising defaults. The one material gap is recursion semantics (whether nested directories are walked without a '**' pattern), which an agent may need before calling.

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 including path, noIgnore, filePattern, includeHidden and excludePattern is already documented in the schema. The description only echoes the glob/type concept and the ignore/hidden defaults, adding no syntax or interaction detail beyond the schema; baseline 3 applies.

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 gives a specific verb and resource ('file enumeration') plus a scope qualifier ('matching glob patterns or file types'), and the phrase 'without scanning file contents' separates it from content-search siblings like search. An agent can tell this is a path/pattern-based lister rather than a content query tool.

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 implied by the capability statement and the disclosed defaults (gitignore respected, hidden files excluded), but there is no explicit when-to-use/when-not guidance and no named alternative such as search or dump_tree. The agent must infer that this is the right tool for pattern-based listing.

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

Deploy Server

Other Tools