Skip to main content
Glama

Read files by glob

read_files
Read-onlyIdempotent

Use this when the exact file list is not already known and the user wants the contents of every file matching one glob under a directory. Use start_search instead to find filenames or text matches without reading every matched file. If exact paths are already known, use read_multiple_files; for one known path use read_file.

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute directory (or single file) to start from.
deviceYesReMCP device id returned by list_devices. Required for every device operation.
patternNoGlob matched against the relative path and the file name, such as "src/**/*.ts" or "*.md". Default **/* .
max_filesNoStop after this many files. Default 100, maximum 500.
include_ignoredNoAlso descend into .git and node_modules. Default false.
max_lines_per_fileNoLines kept per file. Default 2000.

Output Schema

NameRequiredDescriptionDefault
dataNoOptional structured result data for follow-up reasoning and tool calls.
textYesConcise human-readable result of the tool call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the readOnlyHint/idempotentHint annotations, the description clarifies that this tool returns file contents rather than just names and that it reads every matching file. It does not repeat schema details like max_files or line truncation, which are already documented in the parameter descriptions.

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?

Three sentences, all informative and without filler. The core usage condition and behavior are front-loaded, and the alternative-tool guidance is compactly placed at the end.

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?

Given the complete parameter schema, the output schema, and read-only/idempotent annotations, the description supplies everything needed to select and invoke the tool correctly. Missing details like default glob behavior and file-count limits are already present in the schema.

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 the parameter defaults and formats are already fully documented. The description mentions glob-based matching and directory scope but adds little semantic meaning beyond the schema.

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?

Description uses a specific verb and resource: it reads contents of files matching a glob under a directory. It also names the sibling alternatives it is not, making its role unambiguous.

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?

Explicitly states when to use this tool ('exact file list is not already known') and when to use alternatives: start_search for filename/text matches, read_multiple_files for known paths, read_file for a single known path. This fully routes selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources