Skip to main content
Glama

neurocode_slice

Extract a token-budgeted AST slice of repository context via code property graph reachability, enabling bug repair queries to include only relevant code instead of entire files.

Instructions

Extract an AST-sliced repository context bounded strictly under token budget (<=1,200 tokens) using Host-side Code Property Graph reachability. Use this instead of reading entire files into LLM context.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "neurocode_slice"
  }
}

Input Schema

NameRequiredDescriptionDefault
entryNoOptional specific file path or symbol to anchor the AST slice around
issueNoBug report, error traceback, feature request, or coding query
budgetNoStrict token budget limit (default 1200)
repo_pathNoAbsolute or relative path to repository root (default '.').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.3.0
    • changedInput schema / properties / budget / description
      Previous value: -"Maximum token budget (default 1200)"New value: +"Strict token budget limit (default 1200)"
    • addedInput schema / properties / entry
      Added value: +{
      +  "description": "Optional specific file path or symbol to anchor the AST slice around",
      +  "type": "string"
      +}
    • changedInput schema / properties / issue / description
      Previous value: -"Bug report, error traceback, or coding query"New value: +"Bug report, error traceback, feature request, or coding query"
    • addedInput schema / properties / repo_path / default
      Added value: +"."
    • changedInput schema / properties / repo_path / description
      Previous value: -"Absolute or relative path to repository root"New value: +"Absolute or relative path to repository root (default '.')"
    • removedInput schema / required
      Removed value: -[
      -  "repo_path",
      -  "issue"
      -]
  2. First observed

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral load. It discloses the strict token ceiling and the reachability-based selection method, which is meaningful context, but it says nothing about whether the call is read-only (only implied by "Extract"), what happens when the budget cannot be met, or whether the result is truncated or prioritized.

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 sentences, zero filler, with the core capability and the hard constraint front-loaded before the usage recommendation. Nothing is repeated from the schema or left dangling.

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?

For a 4-parameter, all-optional, fully schema-documented tool with no output schema, the definition covers what it does, the hard constraint, and the primary use case. The remaining gap is the interplay between `entry` and `issue` and what the returned slice contains, which matters for a tool whose output is its whole value.

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 100%, so all four parameters are already documented, including the default 1200 budget. The description reinforces that the budget is a strict bound, but adds no semantics for how `entry` and `issue` interact or what anchoring a slice around a symbol does differently from a path.

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?

"Extract an AST-sliced repository context" names a concrete verb and resource, and adds the mechanism (Host-side Code Property Graph reachability) plus the hard cap. It is clear what the tool produces, but it never distinguishes itself by name from plausible overlaps such as neurocode_map, neurocode_symbol, or neurocode_trace, so an agent must infer the boundary.

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?

"Use this instead of reading entire files into LLM context" gives a real usage trigger and implies the alternative (raw file reads). However, it offers no when-not conditions and names no sibling tool as the alternative, so the routing guidance against the other neurocode_* tools is only implied.

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