Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

Read Code Lines with Exact Line Numbers

fs_read_lines

Read precise line ranges from code files, returning total line count, start and end positions, and numbered content for reliable slicing of large files.

Instructions

专为 AI 设计的精确代码行读取工具:始终返回总行数、起止行号及带行号的代码内容,支持超大文件按行切片。

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": {
      "path": "<path>"
    },
    "name": "fs_read_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes目标代码文件路径
endLineNo结束行号(1-based)
startLineNo起始行号(1-based)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations exist, so the description carries the behavioral burden. It does usefully commit to always returning total line count and the actual start/end lines, which helps the agent plan follow-up reads, but it says nothing about out-of-range line numbers, defaults being capped at 200 lines, encoding or binary-file handling, or errors.

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 well-structured sentence with a colon that front-loads the capability and then the guarantees. Only the 'designed for AI' framing is filler that does not earn its place.

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?

With three parameters, no annotations and no output schema, the description must cover both behavior and return shape. It covers the return shape at a high level (line count plus numbered content) but leaves edge-case behavior and error conditions unaddressed, which is a meaningful gap for a file-reading tool.

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 the baseline is 3; the description adds a little by promising the returned range echoes the requested start/end lines and framing them as a slicing mechanism. It does not, however, add meaning about the default window size that the schema supplies.

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?

Uses a specific verb+resource combination ('精确代码行读取' - precise code line reading) and states the guaranteed outputs (total line count, start/end line numbers, line-numbered content). It implicitly distinguishes itself from plain file readers via the line-range slicing focus, but never names a sibling such as fs_read_file or fs_read_tail.

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 phrase '支持超大文件按行切片' hints at the intended scenario (large files, targeted line windows), so usage is implied rather than stated. There is no explicit when-to-use / when-not-to-use guidance and no routing to alternatives like fs_read_tail or fs_batch_read.

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