Skip to main content
Glama

pre_edit_decision_check

Check the line range for prior recorded decisions before editing code. Surfaced intents and constraints determine if you can proceed, need to review, or must investigate upstream.

Instructions

Check whether the line range about to be edited has prior recorded reasoning attached.

Call this BEFORE editing code in a kawa-indexed repo. Surfaces:

  • Tier 1a — overlapping intents whose blocks cover these lines (line-precise team coordination + intent-scoped decisions)

  • Tier 1b — repo decisions whose relatedFiles include this file (file-coarse, catches infer_history-extracted constraints)

(Live-collaborator code-collision awareness is no longer reported here — it now arrives once per turn at the Stop hook. This tool is purely the semantic, decision-based check.)

Decisions already overridden via record_decision(supersedes=...) are filtered out automatically.

Recommendation maps to action:

  • "proceed" — nothing relevant; safe to edit

  • "review" — surfaced context worth inspecting before editing

  • "investigate-upstream" — prior constraint or abandoned approach matches; don't proceed without reading the rationale and either revising the change or recording a new fork decision that supersedes the old one

Also returns the smallest enclosing function/method symbol via tree-sitter (Rust/TS/JS/Python only; null for other languages) for warning readability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineYesEnd line of the touched range (1-based, inclusive)
filePathYesPath to the file being edited (relative to repoPath)
intentIdNoActive intent ID for supersedes scoping. Auto-detected by Muninn when omitted.
repoPathYesLocal path to the repository root (also used to read the file for AST symbol detection)
startLineYesStart line of the touched range (1-based, inclusive)
forkAuthorNoFork attribution; usually resolved by Muninn automatically — pass only for override / testing.
repoOriginNoGit remote origin URL. Auto-detected from repoPath via git if not provided.
workspaceIdNoWorkspace identifier; usually resolved by Muninn automatically — pass only for override / testing.
sessionTokenNoSession scope for the force-override cache. Defaults to the MCP server's SESSION_ID; PreToolUse hook callers should pass Claude Code's session_id so writes from one process are visible to the other.
Behavior4/5

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

With no annotations provided, the description must disclose behavioral traits itself. It explains what the tool surfaces (Tier 1a, Tier 1b), that overridden decisions are filtered out, the recommendation mapping, and the return of the smallest enclosing function symbol (with language limitations). It does not detail side effects or performance, but the read-only nature is implied. Sufficient transparency for an agent.

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?

The description is well-structured with front-loaded purpose and separate paragraphs for tiers, filtering, recommendation mapping, and extra return value. While somewhat verbose, each sentence adds necessary detail. Minor room for tightening, but overall efficient for the complexity.

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?

Despite lacking an output schema, the description adequately conveys the return value (recommendation with actions and a function symbol). It covers when to use, what data is surfaced, and filtering logic. For a 9-parameter tool with nested objects, this is sufficient for an agent to invoke and interpret results.

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 coverage is 100%, so baseline is 3. The description adds value by explaining that intentId is auto-detected, and that forkAuthor, workspaceId, and sessionToken are usually auto-resolved. It also clarifies that repoPath is used to read the file for AST symbol detection. This goes beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states what the tool does: 'Check whether the line range about to be edited has prior recorded reasoning attached.' It details two tiers of surfaced context (Tier 1a and Tier 1b), explains what is no longer reported, and maps recommendations to actions. This is highly specific and distinguishes it from sibling tools like pre_edit_acknowledge or get_resolution_context.

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?

The description explicitly says 'Call this BEFORE editing code in a kawa-indexed repo,' providing clear usage context. It also notes that live-collaborator awareness is handled elsewhere, implicitly guiding when not to rely on this tool for collisions. However, it does not explicitly list alternative tools for other scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kawacode-ai/kawa.mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server