Skip to main content
Glama
Coding Thinker MCP
by awssat

execute_and_review

Apply approved code changes with syntax checks, formatting, backups, and safe git commits; optionally preview via dry run and return a review prompt for architectural critique.

Instructions

Step 4: Execute changes with full safety net.

Process:

  1. Normalize line endings (CRLF → LF)

  2. Apply diffs using unified patching (handles overlaps)

  3. Validate syntax and run ESLint/TypeScript if available

  4. Auto-format with user's prettier config (or detected style)

  5. Back up originals to .mcp-backups/

  6. Write changes to disk

  7. Check git state (detached HEAD, rebase, hooks)

  8. Stage & commit (with graceful hook failure handling)

  9. Return mirror critique prompt for AI review

Set approved=true to proceed. Use dry_run=true to preview without writing.

Mirror critique: The response includes a prompt with modified code that you should analyze to provide honest architectural review (not automated).

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": {
      "session_id": "<session_id>"
    },
    "name": "execute_and_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNo
approvedNo
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.2

TDQS

A3.8/5.0
Behavior4/5

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

With zero annotations, the description carries the full disclosure burden and does so unusually well: it names the backup destination (.mcp-backups/), the validation and formatting passes, the git operations including detached HEAD/rebase/hook checks, and graceful hook-failure handling. Gaps remain around reversibility, whether a failed validation aborts before writing, and required permissions, which keeps it from a 5.

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?

Front-loaded with the step number and purpose, then a tight numbered process list, then parameter guidance, then the return-value note. Every line contributes distinct information with no repeated wording.

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 destructive multi-stage tool with no annotations and no output schema, the description covers the execution pipeline and explains the returned mirror-critique prompt, which substitutes adequately for an output schema. The unexplained required session_id and the absence of failure/abort semantics are the remaining holes.

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 approved (proceed gate) and dry_run (preview without writing) clearly with defaults implied. The required session_id parameter receives no explanation whatsoever, leaving the most important input undefined in both schema and prose.

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 states a concrete verb and effect ('Execute changes with full safety net') and enumerates the nine operations performed, from line-ending normalization through staging and committing. It positions itself as 'Step 4' of a pipeline, which gives ordering context, though it never names a sibling tool or states what distinguishes it from plan_and_verify.

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?

It gives explicit gating conditions for its own parameters — 'Set approved=true to proceed' and 'Use dry_run=true to preview without writing' — plus an implied prerequisite in 'Step 4'. However, it offers no when-not guidance, no statement of what must happen before this step, and no reference to any alternative tool in the pipeline.

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