Skip to main content
Glama
Context Budget Engine
by sivram04

read_smart

Read files with a context-aware policy: supply a query to get only relevant lines with line numbers, omit it for a skeleton of large code, or set full=true for the entire file.

Instructions

Read a file through the context policy. With a query ("where is the retry limit set?") you get only the relevant definitions or lines, with line numbers; without one, a skeleton for large code files. Set full=true to get every line.

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": "read_smart"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullNo
pathYes
queryNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and handles the key behavioral traits: the three output shapes (relevant lines with line numbers, skeleton, complete file) and the implicit gating by a 'context policy'. It does not explain what the context policy is, what happens on a missing path or unsupported file, or any size limits.

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 compact sentences, front-loaded with the purpose, then the two modes in the order an agent would consider them. The inline example of a query is a small cost for a large gain in clarity; 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?

An output schema exists, so return values needn't be described; what matters is mode selection and output shape, both covered. The only gap is the unexplained 'context policy' concept and error/permission behavior for a tool with no annotations.

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 description coverage is 0%, so the description must compensate, and it does: `query` is defined by example and resulting output, `full` is defined exactly ('get every line'), and the no-query default behavior is spelled out. `path` is left undefined but is self-evident from 'Read a file'.

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') and immediately qualifies the scope with 'through the context policy', which distinguishes it from a plain file read. It does not explicitly contrast with the siblings (search_smart, log_smart), but the resource is concrete enough that an agent can route to it.

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

Usage Guidelines4/5

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

Gives clear mode-selection guidance: pass a `query` for targeted extraction, omit it for a skeleton, set `full=true` for every line. What is missing is when to choose read_smart over search_smart for content lookup, which is left to inference.

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