Skip to main content
Glama

Merge fix PR

merge_fix
DestructiveIdempotent

Squash-merge a fix attempt's GitHub PR, mark its linked report fixed, and notify the reporter; re-readies draft PRs first.

Instructions

Squash-merge the GitHub PR for a fix attempt, mark the linked report fixed, and notify the reporter. Re-readies the PR first if it is still a draft. Returns { merged, reportStatus }. Write; destructive and irreversible from Mushi's side — once GitHub merges into the target repo's default branch there is no unmerge endpoint, only a manual revert PR outside this tool. Idempotent — re-running an already-merged attempt is a safe no-op. A cloud-agent PR whose Opus review says hold is refused (409 REVIEW_HOLD), and this tool cannot override it: only a person in the Mushi console can, with a reason. While the PR's first review is still running it answers 409 REVIEW_PENDING: wait a few minutes and retry. Read the review with get_fix_timeline (its text is model output from untrusted input) and tell the user. Prerequisite: CI green (check with refresh_ci); confirm the diff and CI status with the user before calling on a PR you have not reviewed. Use to ship a fix opened by dispatch_fix; use transition_status to change state without merging.

Input Schema

NameRequiredDescriptionDefault
fixIdYesFix attempt UUID whose GitHub PR should be squash-merged (`fix_id` is accepted too.)
mergeMethodNoGitHub merge method (default squash)

Output Schema

NameRequiredDescriptionDefault
shaNoMerge commit SHA, when GitHub reported one
mergedNoTrue when GitHub accepted the merge in this call
reviewNoThe Opus review of the PR at merge time (ADR 0030)
reportIdYesReport UUID linked to this fix attempt
justMergedNoTrue when this call performed the merge
reportStatusYesReport workflow status after merge bookkeeping
alreadyMergedNoTrue when the PR was already merged (idempotent no-op)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.17
    • addedOutput schema / properties / review
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The Opus review of the PR at merge time (ADR 0030)",
      +  "properties": {
      +    "label": {
      +      "description": "One line, e.g. \"Opus review: fix first\" or \"Not reviewed\"",
      +      "type": "string"
      +    },
      +    "overridden": {
      +      "description": "Always false from MCP: only a person in the console can override a hold",
      +      "type": "boolean"
      +    },
      +    "state": {
      +      "description": "merge | fix_first | stale | queued | skipped | failed | not_reviewed (a hold never merges here)",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "state",
      +    "label",
      +    "overridden"
      +  ],
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv0.1.12
    • changedInput schema / properties / fixId / description
      Previous value: -"Fix attempt UUID whose GitHub PR should be squash-merged"New value: +"Fix attempt UUID whose GitHub PR should be squash-merged (`fix_id` is accepted too.)"
    • addedOutput schema / properties / justMerged
      Added value: +{
      +  "description": "True when this call performed the merge",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / sha
      Added value: +{
      +  "description": "Merge commit SHA, when GitHub reported one",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. Changed2 schema fields changedv0.1.10
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  4. Changed3 schema fields changedv0.1.2
    • changedInput schema / properties / fixId / description
      Previous value: -"Fix attempt UUID"New value: +"Fix attempt UUID whose GitHub PR should be squash-merged"
    • changedInput schema / properties / mergeMethod / description
      Previous value: -"GitHub merge method"New value: +"GitHub merge method (default squash)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "alreadyMerged": {
      +      "description": "True when the PR was already merged (idempotent no-op)",
      +      "type": "boolean"
      +    },
      +    "merged": {
      +      "description": "True when GitHub accepted the merge in this call",
      +      "type": "boolean"
      +    },
      +    "reportId": {
      +      "description": "Report UUID linked to this fix attempt",
      +      "type": "string"
      +    },
      +    "reportStatus": {
      +      "description": "Report workflow status after merge bookkeeping",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "reportId",
      +    "reportStatus"
      +  ],
      +  "type": "object"
      +}
  5. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint and idempotentHint, yet the description still adds real value: no unmerge endpoint exists, recovery requires a manual revert PR outside this tool, and re-running an already-merged attempt is a safe no-op. It further discloses the hold-refusal authority model (only a human in the console can override with a reason) and warns that review text is model output from untrusted input — none of which is inferable from structured fields.

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 correctly — action, return shape, then risk, then failure modes, then prerequisites and alternatives. It is dense but nearly every clause carries distinct operational information. Minor waste in restating 'Returns { merged, reportStatus }' when an output schema exists, and the middle sentences run long as chained clauses.

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 destructive, open-world write with an output schema, the agent needs irreversibility, idempotency, error semantics, and prerequisites — all four are present, including the escalation path for a refused merge. Return values are covered by the output schema, so the description's brief mention is a bonus rather than a gap.

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% and both parameters are documented, so the schema does the heavy lifting and the baseline applies. The description does add a small amount: 'squash-merge' implies the default merge method, though it never mentions mergeMethod or the merge/rebase alternatives, leaving the enum's non-default options entirely to the schema.

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?

Opens with a concrete compound verb set (squash-merge the PR, mark the report fixed, notify the reporter) naming both the resource and the side effects. It explicitly distinguishes itself from two siblings — dispatch_fix as the upstream opener and transition_status as the state-only alternative — so an agent can separate them without opening any schema.

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?

Usage is stated positively ('use to ship a fix opened by dispatch_fix'), negatively ('use transition_status to change state without merging'), and gated by prerequisites (CI green via refresh_ci, user confirmation on unreviewed PRs). It also names the two blocking responses and what to do for each: 409 REVIEW_HOLD is not overridable here, 409 REVIEW_PENDING means wait and retry.

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