Skip to main content
Glama

block_code_mutate

Replace the body of an existing bound AST symbol with new code, then run a verify command to confirm the change. For targeted edits only; use the host editor for broader changes.

Instructions

Replace one already-bound AST symbol body. Not a general editor: new files, new symbols, tests, and multi-file edits should use the host editor, then source_sync and source_binding_accept.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
blockIdYes
newCodeYes
projectRootNo
taskContextIdNo
verifyCommandYes
includeStructuredNo
expectedSourceHashNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.3
    • addedInput schema / properties / expectedSourceHash
      Added value: +{
      +  "maxLength": 64,
      +  "minLength": 64,
      +  "type": "string"
      +}
    • addedInput schema / properties / taskContextId
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / verifyCommand / minLength
      Added value: +1
    • changedInput schema / required
      Previous value: -[
      -  "blockId",
      -  "symbol",
      -  "newCode"
      -]New value: +[
      +  "blockId",
      +  "symbol",
      +  "newCode",
      +  "verifyCommand"
      +]
  2. First observedv0.1.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the core action ('replace an already-bound AST symbol body') and the exclusion, but does not mention side effects, destructive nature, verification requirements, or any preconditions beyond 'already-bound.' For a mutation tool, this is a significant gap.

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 two sentences, front-loaded with the purpose, and the exclusion is placed second. It is efficient with no wasted words. However, it could include a few more useful details without becoming bloated, so it's not a perfect 5.

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

Completeness2/5

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

Given the tool's complexity (8 parameters, 4 required, no output schema, no annotations), the description is incomplete. It does not explain the purpose of verifyCommand, expectedSourceHash, or what happens after replacement. It hints at the 'already-bound' precondition but omits critical execution context, making it insufficient for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description provides no explanation of any of the 8 parameters (blockId, symbol, newCode, verifyCommand, etc.). It mentions 'symbol body' but does not map to any parameter or clarify the role of required fields like verifyCommand or expectedSourceHash. The description fails to compensate for the lack of schema documentation.

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 states a specific verb and resource: 'Replace one already-bound AST symbol body.' It further distinguishes itself by explicitly naming what it is not ('Not a general editor') and routing new symbols, tests, and multi-file edits elsewhere. This makes it clear what this tool does and how it differs from siblings.

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?

The description gives explicit when-not-to-use guidance: 'Not a general editor: new files, new symbols, tests, and multi-file edits should use the host editor, then source_sync and source_binding_accept.' It names the alternatives and conditions, leaving no ambiguity about when to choose this tool.

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