Skip to main content
Glama
surgical-context-mcp

surgical-context-mcp

by erayerturk

get_edit_context

Call before modifying a symbol to retrieve budgeted, AST-aware edit context—file skeleton, target body, callers, callees, signatures, and coverage warnings—so agents avoid full-file reads.

Instructions

Call before modifying a symbol. Returns file skeleton, full target body, used members/callees, caller ±5L windows, other signatures, and coverage warnings within budget_tokens.

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": {
      "symbol": "<symbol>"
    },
    "name": "get_edit_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYes
project_pathNo
budget_tokensNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full behavioral burden, and it does state the concrete payload and that output is bounded by budget_tokens, plus that coverage warnings may be included. It does not say whether the call is read-only/no side effects or what happens when the budget is too small to include the target body, which are meaningful gaps for a tool with zero annotation coverage.

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 imperative action guidance front-loaded before the return payload. Every clause carries information the 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?

An output schema exists, so the description need not explain return values in detail, and the enumerated payload plus budget note is sufficient for correct invocation. The only real omission is guidance on project_path and on what to do if coverage warnings indicate the context is incomplete.

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 0%, so the description must compensate for all three parameters. It explains budget_tokens as a cap on returned context and implies 'symbol' is the target being edited, but project_path is never mentioned and no format hints (symbol syntax, path form, budget units) are given. Partial compensation justifies a middle score.

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 uses a concrete verb ('Returns') and enumerates the context bundle: file skeleton, target body, members/callees, caller windows, other signatures, and coverage warnings. That is far more specific than a generic 'get context', and it implicitly distinguishes this pre-edit context gatherer from impact-analysis siblings like get_symbol_impact. It stops short of naming a sibling explicitly, so it is clear but not fully differentiated.

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?

'Call before modifying a symbol' gives an explicit trigger condition, which is the key when-to-use signal for an agent. There is no statement of when not to use it or which sibling to prefer for related questions (e.g. rename safety vs. impact), so it is clear context without exclusions.

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