Skip to main content
Glama

read_slice

Read-onlyIdempotent

Read a specific 1-based line range from a file to inspect only relevant code or log sections, reducing token use when full contents are unnecessary.

Instructions

Lines start-end (1-based, max 400).

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>",
      "startLine": "<startLine>",
      "endLine": "<endLine>"
    },
    "name": "read_slice"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile
endLineYes
startLineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world behavior, so the safety profile is covered. The description does add one genuine behavioral constraint beyond them — the 400-line maximum per call — but says nothing about out-of-range requests, truncation behavior, or error conditions.

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

Conciseness3/5

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

A single punchy fragment with no wasted words, but it is under-specified rather than well-structured — there is no complete sentence, no verb, and the constraint carves out space that should have gone to stating what the tool returns.

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?

For a simple three-parameter annotated read tool this is close to adequate: the key limit and indexing convention are present. But with no output schema, the description should at least indicate that line content is returned and how partial/out-of-range ranges are handled.

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 coverage is only 33% (only 'path' is described as 'File'), so the description must compensate for startLine and endLine. It partially does by establishing 1-based indexing and the 400-line span limit, but leaves ordering assumptions and out-of-range semantics undocumented.

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

Purpose3/5

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

The description is a fragment that conveys the slice semantics — lines start-end, 1-based, capped at 400 — which pairs with the tool name read_slice and the 'path' param to imply reading file content. However, it never states the verb or resource explicitly, so the purpose is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this versus read_symbol, file_outline, search_compact, or digest_log. An agent must guess that this is for raw line-range extraction while the siblings handle structural or search-oriented reads.

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