Skip to main content
Glama
JacobBhatt12

ATR (Automation for Token Reduction)

by JacobBhatt12

atr_search_code

Read-only

Locate definitions or usages with regex before opening files, returning matches grouped by path and line; add surrounding context to answer without reading whole files.

Instructions

Find where something is defined or used, before reading any file. Regex, grouped by file (path:line: text); context=3 shows the lines around each hit, often enough to answer.

Input Schema

NameRequiredDescriptionDefault
globNoOnly these files, e.g. *.py or src/**/*.ts
pathNoFolder (default: the project).
budgetNo
contextNoLines to show around each match (default 0, try 3).
patternYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and non-destructive, so the description doesn't need to re-establish safety. It adds real value by disclosing the output shape (grouped by file, path:line: text) and how context expands results, though it says nothing about regex dialect, match limits, or what budget does.

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?

Two tight sentences with the primary action and the read-avoidance rationale front-loaded; every clause carries information an agent needs.

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?

Covers purpose, output format, and the key context tactic despite there being no output schema. The main gap is the undocumented budget parameter and any hint about result caps or regex flavor.

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 60%; 'Regex' clarifies that pattern is a regular expression rather than a literal string, which is useful. The context explanation largely restates the schema text, and budget has no description in either place.

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: find where something is defined or used. The phrase 'before reading any file' implicitly contrasts it with atr_read/atr_read_file, but no sibling is named directly, so differentiation is inferred rather than explicit.

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?

'before reading any file' gives clear situational guidance and 'often enough to answer' tells the agent it may not need a follow-up read. No explicit exclusions or alternatives are named beyond that implication.

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