Skip to main content
Glama

plan_adaptive_retrieval

Plans adaptive code retrieval by choosing whole-file, symbol, dependency, or caller context and ranking candidates within a token budget for a given task.

Instructions

Task-Aware Adaptive Retrieval Engine: Dynamically selects whole-file (for small files <120 lines), targeted symbols, symbols + dependencies, or symbols + callers, with candidate ranking justifications, token budget limits, and uncertainty classification (Resolved vs Potential vs Unknown).

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": {
      "task": "<task>"
    },
    "name": "plan_adaptive_retrieval"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYesTask description or target symbols/files (e.g. 'Extract SleepInhibitor and handle tunnel in cli.py')
root_dirNoPath to the repository root directory (default: '.').
token_budgetNoMaximum token budget for returned context (default: 3000)
target_symbolsNoOptional list of exact symbol names to focus on
strategy_overrideNoOptional strategy override (default: 'auto')auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

B3.2/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 full burden. It adds real behavioral signal: token budget enforcement, candidate ranking justifications, and an uncertainty taxonomy (Resolved/Potential/Unknown). It does not state that the operation is read-only/planning or what the response looks like, which matters for a tool with no output schema.

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?

One dense sentence with no filler, and the strategy list is front-loaded. It reads as a feature inventory rather than a task statement, and the leading 'Task-Aware Adaptive Retrieval Engine' label works more like a title than useful content.

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 5-parameter planning tool with no annotations and no output schema, the description conveys decision behavior and output concepts (justifications, uncertainty classes) but never specifies the returned structure or how the strategies map to results. Adequate, with clear gaps an agent would notice on first call.

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 the schema already documents task, root_dir, token_budget, target_symbols, and strategy_override, including the enum values. The description reinforces token-budget limiting and the auto strategy's thresholds but adds no format detail beyond the schema. Baseline 3 applies.

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?

The description states a concrete capability: retrieving code context with dynamic strategy selection (whole-file under 120 lines, targeted symbols, symbols+dependencies, symbols+callers). That is a specific verb-and-resource statement an agent can act on. It never distinguishes itself from close siblings such as locate_surgical_context or scan_uncertainty, so it stops short of 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 Guidelines2/5

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

There is no when-to-use guidance at all: nothing says which situations call for this planner versus locate_surgical_context, check_code_health, or scan_uncertainty. The 'small files <120 lines' clause is an internal strategy heuristic, not guidance for the caller. The agent must infer triggering conditions entirely from the name.

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