Skip to main content
Glama

Re-roll one patch against a release

reroll_patch
Read-onlyIdempotent

Re-roll one composer patch that check_patches reported conflicts: a 3-way merge of the patch onto the installed release, returned as a new diff. Call check_patches first for the whole list. Call this once per patch that came back conflicts.

  • Input: project, version, patch, title, base. patch is the diff text; this service downloads nothing, so fetch a URL patch yourself and send what came back. base is the release the site had before the upgrade. One patch per call. A hand-made patch without index lines is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used.

  • reroll.verified true: the service already ran the check. reroll.verified_by: the command, the -p level and the tag. Write reroll.patch to the patch file and move on. Do not run git apply --check or patch --dry-run. Do not diff against a copy of the release. composer install is the test.

  • After a conflicts result, send the same project, version and patch again with resolutions, one per region of reroll.conflicts[].hunks. A resolution is {file, region, choice: release|patch}, {file, region, text}, or {file, region, delete: true}. The service re-merges with your decisions and apply-checks the diff. What comes back is the finished patch file: write it and run composer install. Do not read the release files, edit the patch by hand, or dry-run it.

  • reroll.status clean: every file merged and the diff apply-checked against the release, reroll.verified true. Write reroll.patch as the new patch file; no re-test needed. An empty reroll.patch with reroll.note means the release already has the change; suggested is merged.

  • reroll.status conflicts: reroll.patch holds the hunks that merged cleanly, apply-checked when reroll.verified is true. Each file in reroll.conflicts has hunks with the three sides of every region. release: what the release has. base: what the patch was written against. patch: what the patch wants. release_line and release_context: the release file's numbered lines around the region. Write the missing hunks from those and append them to reroll.patch. No download, file read or dry-run is needed.

  • reroll.syntax_errors: files that do not parse after the merge, with the parser's line. reroll.verified is false then, though the diff applies. Fix the text of the resolutions on those files and call again.

  • reroll.status unavailable: no release takes the patch, or it was made from a commit in no release; reroll.error says which. Re-roll by hand from hunks_failed.

  • reroll.patch paths are relative to the repository root. Contrib patches apply at -p1. Core patches start with core/ and apply at -p2 from web/core. patch_truncated: the diff was cut to the result budget; POST /v1/patch/check on api.tresbien.tech with reroll: true returns it whole.

  • A patch that still applies (applies_at set) or is already in the release (merged) returns its verdict with reroll null.

  • core_references: as on check_patches, read from the re-rolled diff when the merge was clean. Removed or moved core classes, and calls whose argument count no longer fits the target signature, at target_core.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseNoOptional. The release the site had before the upgrade. Its commit sha from composer.lock (source.reference), or its composer version: 6.1.0 when version is 6.2.0. A patch without index lines is merged from it when it applies there, before the newest tags are tried.
patchYesUnified diff text. This service downloads nothing, so fetch a URL patch yourself and send what came back. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used.
titleNoOptional, echoed back.
projectYesdrupal.org machine name (webform) or composer name (drupal/webform); drupal or core for Drupal core.
versionYesThe composer version installed, e.g. 1.13.0 or 11.4.5.
resolutionsNoDecisions for the conflicted regions of a previous call on the same project, version and patch, one entry per region. region: the index in that file's conflicts[].hunks. {file, region, choice}: choice is release or patch. {file, region, text}: your own text for the region. {file, region, delete: true}: empty the region. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing.
target_coreNoThe core version the added code is checked against (11.4.5). Defaults to version for a core patch.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changed
    • changedInput schema / properties / base / description
      Previous value: -"Optional. The package's release installed before the upgrade, not version. Its commit sha from composer.lock (source.reference), or its composer version: 6.1.0 when version is 6.2.0. A patch without index lines is merged from it when it applies there, before the newest tags are tried."New value: +"Optional. The release the site had before the upgrade. Its commit sha from composer.lock (source.reference), or its composer version: 6.1.0 when version is 6.2.0. A patch without index lines is merged from it when it applies there, before the newest tags are tried."
    • changedInput schema / properties / patch / description
      Previous value: -"Unified diff text, or a drupal.org or git.drupalcode.org patch URL. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used."New value: +"Unified diff text. This service downloads nothing, so fetch a URL patch yourself and send what came back. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used."
  2. Changed1 schema field changed
    • changedInput schema / properties / base / description
      Previous value: -"Optional. The release the site runs: a commit sha, or a composer version. A patch without index lines is merged from it when it applies there, before the newest tags are tried."New value: +"Optional. The package's release installed before the upgrade, not version. Its commit sha from composer.lock (source.reference), or its composer version: 6.1.0 when version is 6.2.0. A patch without index lines is merged from it when it applies there, before the newest tags are tried."
  3. Changed2 schema fields changed
    • addedInput schema / properties / base
      Added value: +{
      +  "description": "Optional. The release the site runs: a commit sha, or a composer version. A patch without index lines is merged from it when it applies there, before the newest tags are tried.",
      +  "type": "string"
      +}
    • changedInput schema / properties / patch / description
      Previous value: -"Unified diff text, or a drupal.org or git.drupalcode.org patch URL. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from the newest tag it applies to, given as reroll.base."New value: +"Unified diff text, or a drupal.org or git.drupalcode.org patch URL. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used."
  4. Changed3 schema fields changed
    • changedInput schema / properties / patch / description
      Previous value: -"Unified diff text, or a drupal.org / git.drupalcode.org patch URL. With the index lines git diff writes it is merged onto the release; without them (hand-made) it is merged from the newest tag it applies to, reported as reroll.base."New value: +"Unified diff text, or a drupal.org or git.drupalcode.org patch URL. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from the newest tag it applies to, given as reroll.base."
    • changedInput schema / properties / resolutions / description
      Previous value: -"Decisions for the conflicted regions of a previous call on the same project, version and patch: one entry per region, {file, region, choice} where region is the index in that file's conflicts[].hunks and choice is release or patch, {file, region, text} to put your own text there instead, or {file, region, delete: true} to empty the region. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing."New value: +"Decisions for the conflicted regions of a previous call on the same project, version and patch, one entry per region. region: the index in that file's conflicts[].hunks. {file, region, choice}: choice is release or patch. {file, region, text}: your own text for the region. {file, region, delete: true}: empty the region. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing."
    • changedInput schema / properties / target_core / description
      Previous value: -"Core version the code the patch adds is checked against (11.4.5); defaults to version for a core patch."New value: +"The core version the added code is checked against (11.4.5). Defaults to version for a core patch."
  5. Changed2 schema fields changed
    • changedInput schema / properties / resolutions / description
      Previous value: -"Decisions for the conflicted regions of a previous call on the same project, version and patch: one entry per region, {file, region, choice} where region is the index in that file's conflicts[].hunks and choice is release or patch, or {file, region, text} to put your own text there instead. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing."New value: +"Decisions for the conflicted regions of a previous call on the same project, version and patch: one entry per region, {file, region, choice} where region is the index in that file's conflicts[].hunks and choice is release or patch, {file, region, text} to put your own text there instead, or {file, region, delete: true} to empty the region. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing."
    • addedInput schema / properties / resolutions / items / properties / delete
      Added value: +{
      +  "type": "boolean"
      +}
  6. Changed1 schema field changed
    • addedInput schema / properties / resolutions
      Added value: +{
      +  "description": "Decisions for the conflicted regions of a previous call on the same project, version and patch: one entry per region, {file, region, choice} where region is the index in that file's conflicts[].hunks and choice is release or patch, or {file, region, text} to put your own text there instead. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "choice": {
      +        "type": "string"
      +      },
      +      "file": {
      +        "type": "string"
      +      },
      +      "region": {
      +        "type": "integer"
      +      },
      +      "text": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "file",
      +      "region"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  7. Changed2 schema fields changed
    • changedInput schema / properties / patch / description
      Previous value: -"Unified diff text, or a drupal.org / git.drupalcode.org patch URL. Needs the index lines git diff writes; a hand-made patch without them cannot be merged."New value: +"Unified diff text, or a drupal.org / git.drupalcode.org patch URL. With the index lines git diff writes it is merged onto the release; without them (hand-made) it is merged from the newest tag it applies to, reported as reroll.base."
    • changedInput schema / properties / project / description
      Previous value: -"drupal.org machine name or composer name (drupal/redis); drupal or core for Drupal core."New value: +"drupal.org machine name (webform) or composer name (drupal/webform); drupal or core for Drupal core."
  8. Changed1 schema field changed
    • changedInput schema / properties / project / description
      Previous value: -"drupal.org machine name; drupal or core for Drupal core."New value: +"drupal.org machine name or composer name (drupal/redis); drupal or core for Drupal core."
  9. Changed1 schema field changed
    • addedInput schema / properties / target_core
      Added value: +{
      +  "description": "Core version the code the patch adds is checked against (11.4.5); defaults to version for a core patch.",
      +  "type": "string"
      +}
  10. Added

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses important behavior beyond annotations: the service downloads nothing, patch merging depends on index lines/base, verification semantics (reroll.verified), and exact actions for clean/conflicts/syntax_errors/unavailable states. These details complement the readOnlyHint and idempotentHint annotations without contradicting them.

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 long but front-loaded with the core purpose and organized by response statuses, making it scannable. It earns its length for a complex re-merge workflow, though a few repeated merge/apply-check notes could be tightened.

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?

With no output schema, the description fully covers return semantics: reroll.status values, verified/verified_by, patch truncation, path conventions, and core_references. It leaves no major aspect of invocation or interpretation undocumented.

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 workflow-level meaning on top: 'one patch per call', how base is used for hand-made patches, and the resolution variant shapes, which helps disambiguate cases the schema only lists structurally.

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 opens with a specific verb and resource: 'Re-roll one composer patch that check_patches reported conflicts,' and explains the operation as a 3-way merge returned as a new diff. It clearly distinguishes itself from check_patches and other siblings by naming the prerequisite tool and the per-patch scope.

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?

It explicitly instructs to call check_patches first, call reroll_patch once per conflicting patch, and provides detailed when-to-use guidance for each reroll.status outcome. It also gives exclusions ('Do not run git apply --check or patch --dry-run') and alternative routes for truncated patches.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.6/5.0
Disambiguation4/5

Tools cluster into related families (change records, symbol usage, patch checks), but descriptions and cross-references clearly separate list vs detail vs diff operations. Some adjacent tools like lookup_core_symbol and list_symbol_users require careful reading, yet their purposes are distinct enough for an agent to select correctly.

Naming Consistency4/5

Most tools follow a clear snake_case verb_noun pattern: list_*, get_*, lookup_*, query_, scan_, search_, reroll_, describe_. A few names like project_profile, subsystem_coupling, and what_changed deviate from verb_noun but remain consistent in style and readable.

Tool Count4/5

At 16 tools, the set is slightly above the typical well-scoped range, but the domain is broad: patch lifecycle, composer scanning, symbol lookup, change records, project profiles, dataset queries, and code search. Each tool covers a distinct query surface, so none feels redundant.

Completeness5/5

The toolkit covers the full read-only analysis lifecycle: scanning composer constraints, checking and re-rolling patches, exploring datasets, looking up core symbols and their users, listing change records, profiling projects, and assessing upgrade readiness. No obvious dead ends or missing operations for its stated purpose.

Resources