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 or fuzzy: a new diff that applies to the installed release. Call check_patches first for the whole list. Call this once per patch that came back conflicts or fuzzy.

  • 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.

  • drop_tests: leave it out and the re-roll drops every file the release package omits. false keeps every hunk, for a site installed from source. reroll.dropped_paths lists what went.

  • 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, or GNU patch applied every hunk, 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 already in the release (merged), or one git apply accepts unchanged, returns its verdict with reroll null. A patch that applies only because a lenient sweep took it (fuzzy) is re-rolled, since a strict patch manager refuses it. Its re-roll keeps the lines GNU patch writes with fuzz, the code a lenient patch manager installs, and reroll.base stays empty.

  • 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.
drop_testsNoOptional. Leave it out and the re-roll drops every file the release package omits, read from the release's own archive. false keeps every hunk, for a site installed from source.
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_coreNoCore the added code is checked against: a minor (11.4 or 11.4.x) or a release (11.4.5). A minor with no core release in the data is refused, and so is a major alone. latest checks no references. Defaults to version for a core patch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / drop_tests / description
      Previous value: -"Optional. true leaves the patch's test files out of the re-roll, false keeps them. Without it, core 12 and later leave them out and every other patch keeps them."New value: +"Optional. Leave it out and the re-roll drops every file the release package omits, read from the release's own archive. false keeps every hunk, for a site installed from source."
  2. Changed1 schema field changed
    • changedInput schema / properties / target_core / description
      Previous value: -"The core version the added code is checked against (11.4.5). Defaults to version for a core patch."New value: +"Core the added code is checked against: a minor (11.4 or 11.4.x) or a release (11.4.5). A minor with no core release in the data is refused, and so is a major alone. latest checks no references. Defaults to version for a core patch."
  3. Changed1 schema field changed
    • addedInput schema / properties / drop_tests
      Added value: +{
      +  "description": "Optional. true leaves the patch's test files out of the re-roll, false keeps them. Without it, core 12 and later leave them out and every other patch keeps them.",
      +  "type": [
      +    "null",
      +    "boolean"
      +  ]
      +}
  4. 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."
  5. 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."
  6. 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."
  7. 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."
  8. 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"
      +}
  9. 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"
      +  ]
      +}
  10. 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."
  11. 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."
  12. 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"
      +}
  13. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds significant behavioral detail: it downloads nothing (so the user must fetch the patch), it merges patches from base or tags, it explains the meaning of reroll.status and reroll.verified, and it instructs the user on what not to do (e.g., 'Do not run git apply --check or patch --dry-run'). No contradiction with annotations; the description enhances transparency beyond the 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?

The description is very long and dense, but it is well-structured with bullet points and clear sections (Input, status handling, etc.). Every sentence carries necessary operational detail—there is no fluff. However, it could be more concise by summarizing key points or moving some details to an output schema; as-is, it is verbose but justified by the tool's complexity.

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?

Given the tool's complexity (8 parameters, multiple statuses, nested resolutions) and the absence of an output schema, the description covers every aspect: input requirements, how to interpret results, what to do for each status (clean, conflicts, syntax_errors, unavailable), and even edge cases like fuzzy patches and already-merged patches. It is complete enough that an agent can call the tool correctly without external documentation.

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

Parameters5/5

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

Schema coverage is 100% (every parameter has a description). The tool description adds substantial meaning beyond the schema: for 'patch' it explains the difference between index lines and hand-made patches, for 'base' it details the merge fallback order, for 'drop_tests' it clarifies the effect on the re-roll, and for 'resolutions' it provides a detailed structure and behavior. This goes well beyond the schema's one-line descriptions, making parameters far more actionable.

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 clearly states the tool's purpose: 'Re-roll one composer patch that check_patches reported conflicts or fuzzy: a new diff that applies to the installed release.' It specifies the verb (re-roll), the resource (composer patch), and the condition (conflicts or fuzzy), distinguishing it from the sibling check_patches.

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 explicit: 'Call check_patches first for the whole list. Call this once per patch that came back conflicts or fuzzy.' It also describes when to send resolutions, what to do after each status (clean, conflicts, etc.), and even warns against manual steps like running git apply --check or editing the patch by hand. Clear when-to-use and when-not-to-use guidance is present.

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.

Resources