Skip to main content
Glama

review_precommit

Run a pre-commit sanity check that auto-captures staged git changes to catch last-minute blockers and warnings before committing. Returns readiness status, model info, and capture source to ensure accurate review.

Instructions

Final sanity check right before committing. Auto-captures staged git changes. Call this after git add and before git commit to catch last-minute issues. Returns ready_to_commit, blockers, warnings, responding models, and persistence provenance. An auto-captured check also returns captured_from: the absolute directory the bridge ran git in. If that is not the repository you are working in, pass the diff explicitly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute path to the directory this review runs in — the repository or git worktree whose code is being reviewed. Auto-capture, repository instruction files, and the reviewer subprocess all use it. Always pass it: an auto-capturing review without it is refused unless the server is configured with "require_cwd": false, in which case the server's launch directory is used. Must be absolute; "~" is not expanded. Applies to this call only — pass it again on resume.
diffNoExplicit diff to review instead of auto-capture
tierNoPick the reviewing model by capability tier instead of by id: "max" (hardest problems — architecture, concurrency, security, subtle bugs), "balanced" (everyday review), or "fast" (small diffs, precommit sanity, quick iteration). Tiers map per provider (Codex: gpt-6-astra / gpt-5.6-sol / gpt-5.6-luna; Gemini: 3.1 Pro (High) / 3.8 Flash (High) / 3.8 Flash (Medium)) and survive failover. Pass either tier or model, not both.
modelNoOverride the configured default model for this call with a concrete id (e.g. "gpt-5.6-sol") or "latest". To choose by capability use the tier parameter instead (a tier word is still accepted here). May be combined with session_id to change model mid-session; without it a resumed session keeps the model it was recorded with. Compare returned resolved and observed labels for runtime changes.
auto_diffNoAuto-capture staged git changes. Omit to use the project config default (review_standards.precommit.auto_diff).
checklistNoCustom pre-commit checks
session_idNoContinue from previous review

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.9.0
    • addedInput schema / additionalProperties
      Added value: +{}
    • changedInput schema / properties / model / description
      Previous value: -"Override the configured default model for this call (e.g., \"gpt-5.6-sol\"), or \"latest\". Or pick a tier instead of a model id: \"max\" (hardest problems — architecture, concurrency, security, subtle bugs), \"balanced\" (everyday review), or \"fast\" (small diffs, precommit sanity, quick iteration). Tiers map per provider (Codex: gpt-6-astra / gpt-5.6-sol / gpt-5.6-luna; Gemini: 3.1 Pro (High) / 3.8 Flash (High) / 3.8 Flash (Medium)) and survive failover. May be combined with session_id to change model mid-session; without it a resumed session keeps the model it was recorded with. Compare returned resolved and observed labels for runtime changes."New value: +"Override the configured default model for this call with a concrete id (e.g. \"gpt-5.6-sol\") or \"latest\". To choose by capability use the tier parameter instead (a tier word is still accepted here). May be combined with session_id to change model mid-session; without it a resumed session keeps the model it was recorded with. Compare returned resolved and observed labels for runtime changes."
    • addedInput schema / properties / tier
      Added value: +{
      +  "description": "Pick the reviewing model by capability tier instead of by id: \"max\" (hardest problems — architecture, concurrency, security, subtle bugs), \"balanced\" (everyday review), or \"fast\" (small diffs, precommit sanity, quick iteration). Tiers map per provider (Codex: gpt-6-astra / gpt-5.6-sol / gpt-5.6-luna; Gemini: 3.1 Pro (High) / 3.8 Flash (High) / 3.8 Flash (Medium)) and survive failover. Pass either tier or model, not both.",
      +  "enum": [
      +    "max",
      +    "balanced",
      +    "fast"
      +  ],
      +  "type": "string"
      +}
  2. First observedv1.8.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses auto-capture behavior, the returned fields (ready_to_commit, blockers, warnings, responding models, persistence provenance), and the captured_from caveat. It doesn't address side effects or failure modes (e.g., no staged changes), leaving some behavior implicit, but it is substantially transparent.

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 front-loaded with the purpose and timing, then details return fields and a caveat. Every sentence carries useful information, though it is slightly longer than strictly necessary at six sentences.

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?

Given no output schema, the description compensates by listing the expected return fields and the auto-capture edge case. It doesn't cover all behaviors (e.g., what happens with no staged changes, or relationship to checklist/session_id), but those are partially covered by the detailed input schema. Overall it's complete enough for an agent to invoke correctly.

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 100%, so the baseline is 3. The description adds only marginal context, such as the instruction to pass the diff explicitly when auto-capture targets the wrong directory, but the schema already documents each parameter's meaning. No additional parameter semantics beyond the schema are provided.

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: a 'final sanity check right before committing' that 'auto-captures staged git changes.' It clearly situates the tool in the pre-commit workflow, distinguishing it from the sibling review_* tools by its timing and scope.

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?

It gives explicit timing guidance: 'Call this after git add and before git commit.' It also provides a conditional instruction to pass the diff explicitly if the captured directory does not match the working repo. It doesn't name when-not-to-use or alternatives among siblings, so it's a 4 rather than a 5.

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