Skip to main content
Glama

fix_symbol

Rewrite one named function, method, or class in place by symbol name, with syntax validation and atomic, rollback-able writes that stay immune to line drift.

Instructions

Rewrite one named function, method or class in place. The symbol is extracted with the language's own parser, sent to a worker model, validated, and spliced back atomically. Addressing by name is immune to line drift, so it is safe to issue many against the same file. Skip this only when the edit is too small for a symbol boundary to matter — a one-line typo, a single config value, a comment. Anything that changes what a function does should go through here even when you already read the code: unlike a manual edit, this re-resolves the symbol by name (immune to line drift from earlier edits landing in the same file), validates syntax before writing, and is rollback-able from a saved git blob. Having read the file first buys a manual edit none of that.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
verifyNoOptional shell command run after the write lands, cwd the repo root — e.g. 'pytest tests/test_foo.py -q' or 'php -l path/to/file.php'. Non-zero exit reverts the write and returns the command's output instead of reporting success. The one thing a subagent gets for free by running the suite itself.
contextNoOptional. Signatures or snippets the worker needs. Bare sibling signatures are usually useless; send what actually matters, such as the shape of a parameter.
file_pathYesPath to the source file.
instructionYesWhat to change, stated compactly. The worker sees only this symbol, so anything it needs to know that is not in the code must be said here or passed in context.
symbol_nameYesFunction or method name. Qualify as 'Class::method' when the bare name is ambiguous — ambiguity is rejected, never guessed.
allow_secretsNoOverride Heimdall, the gate that refuses to send anything looking like a credential to the worker. Only after seeing what it flagged and judging it a false positive. The override is recorded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.5/5.0
Behavior5/5

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

No annotations, so the description carries the full burden and it does. It discloses the pipeline (parse → worker → validate → atomic splice), line-drift immunity, syntax validation before writing, rollback-ability from a saved git blob, and the existence of a secrets gate. These are non-obvious behavioral traits an agent must know to pick this over a manual edit.

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?

Front-loaded with the core action, then usage, then rationale. The final two clauses ('unlike a manual edit... Having read the file first buys a manual edit none of that') re-argue the same point already made one sentence earlier, and the rhetorical closing is padding. Otherwise efficient and well-ordered.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, it covers safety (atomic, validated, rollback-able), addressing semantics (name-qualified, ambiguity rejected), and failure paths (verify non-zero exit reverts). An agent has enough to call it correctly and to know when not to.

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 the baseline is 3. The description adds real meaning beyond the schema: the reason addressing by name is safe ('immune to line drift'), and the rationale for context ('the worker sees only this symbol'). The parameter-level docs also add substantial nuance (verify reverting on non-zero exit, allow_secrets recording the override), though that credit belongs to the schema itself. Description-level contribution above baseline is modest but real.

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+resource: 'Rewrite one named function, method or class in place.' It explains the mechanism (parser extraction, worker model, validation, atomic splice). It does not explicitly differentiate from the closest sibling fix_symbols (plural), which is presumably batch. That is a notable gap in a family where singular vs plural matters a lot.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicit when-not: 'Skip this only when the edit is too small for a symbol boundary to matter — a one-line typo, a single config value, a comment.' And explicit when: 'Anything that changes what a function does should go through here even when you already read the code.' It also argues against the alternative (a manual edit) with concrete reasons. Nothing is left to inference.

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