Skip to main content
Glama
mcp-dependency-explorer
by kozer

Read module file

read_file

Read a specified file from an npm module or workspace, optionally limited to a line range, to inspect package source code and implementation details.

Instructions

Read a file from a module with optional line range

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "module": "<module>",
      "file": "<file>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesFile path relative to module root
rootNoProject root directory (defaults to cwd)
countNoNumber of lines to read
moduleYesModule name
startLineNoStart line (1-based)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry the behavior burden, and "Read" does make the non-destructive, read-only nature clear along with the line-range capability. However, it is silent on default behavior when no range is given, truncation or size limits, encoding, and error handling for missing files or modules.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler, and the most important qualifier (module scoping) comes first. It is efficient, though the terseness leaves little structure for an agent to work with.

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

Completeness3/5

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

The fully described schema and the absence of an output schema reduce what the description must cover, and the core purpose plus range behavior are stated. It remains incomplete on fallback behavior (whole-file read vs. none), limits, and error conditions, which matter for an agent deciding how to call it.

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 all five parameters are already documented in the schema, establishing a baseline of 3. The description reinforces the module scope and the optional line range but adds no format, default, or interaction detail beyond the schema.

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

Purpose4/5

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

States a specific verb and resource ("Read a file from a module") plus a scoping capability ("optional line range"), which lets an agent tell it apart from get_symbol, list_symbols, list_modules, and search, none of which return file contents. It stops short of naming any sibling explicitly, so it earns a 4 rather than a 5.

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 only implied: the verb "Read" signals retrieval of file contents, and "optional line range" hints at partial reads for large files. There is no statement of when to prefer this over search or get_symbol, and no prerequisites or exclusions are given.

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