Skip to content
GitmoapAPIBeta
Planissue-code-links
GET/repositories/{repo_id}/issues/{issue_id}/merge-requests

List the merge requests linked to a repository work item

list_issue_merge_requests
  • issue:read
    A token needs the issue:read scope: Read work items and their settingsGranted by mcp_agent, mcp_agent_write, read_api, read_repository, write_api, write_repository.Every operation this scope unlocks
  • Filtered across resources

    x-gitmoap-isolation: {"kind":"cross_resource_filtered"}

  • Paginated
    Pass the next_token a page returns to get the next one.

Returns the merge requests whose title or description names the work item, a page at a time, each with whether it closes the work item when merged (Closes #412) or only mentions it. The links follow edits to the merge request. Merge requests you cannot see are left out, so a page can hold fewer than limit entries while next_token still leads to more.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID
  • issue_idIssueId (integer · int64)Work-item iid
Query
  • limitinteger · int32optionalPage size (default 20, max 100)
  • next_tokenstringoptionalPagination cursor

Responses

200The merge requests whose bodies name this work item, in repositories the caller may seeapplication/json
  • itemsarray of object
    • closingbooleanWhether the merge request says it finishes the work item (Closes #412) rather than merely mentioning it. Merging a closing merge request closes the item.
    • merge_requestMergeRequest
      • The MergeRequest schema
      • created_atstring
      • created_byPrincipalId (string · uuid)The person or agent who opened it.
      • is_draftboolean
      • merge_request_idMergeRequestId (integer · int64)
      • repository_idRepositoryId (string · uuid)
      • source_branchBranchName (string)
      • source_branch_deletedboolean
      • source_branch_headCommitHash (string)
      • statusMergeRequestStatusopenmergedclosed
      • target_branchBranchName (string)
      • target_branch_headCommitHash (string)
      • titleMrTitle (string)
      • updated_atstring
      • author_can_pushboolean or nulloptionalWhether the author can push to the repository — false for a drive-by contributor's merge request. Absent where it was not computed.
      • closed_atstring or nulloptional
      • closed_byPrincipalId (string · uuid) or nulloptional
      • descriptionMrDescription (string) or nulloptional
      • merge_commit_shaCommitHash (string) or nulloptional
      • merged_atstring or nulloptional
      • merged_byPrincipalId (string · uuid) or nulloptional
      • restack_requiredbooleanoptionalPrecise restack signal — set when this MR's downstack was squash-merged (a rebase is genuinely required to drop the duplicated diff). Distinct from the advisory commits_behind. Reset on the MR's next source-advancing write.
      • stack_summaryStackSummary or nulloptionalThe neighbouring merge requests in this stack. Returned when fetching a single merge request, not in listings.
      • versioninteger · int64optional0–∞Optimistic-concurrency counter. Bumped on every write; writes condition on the read value.
    • repository_idRepositoryId (string · uuid)The repository the merge request is in.
  • next_tokenstring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"closing": false,
"merge_request": {
"created_at": "2026-10-09T12:36:24Z",
"created_by": "b7e2d1c0-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
"is_draft": false,
"merge_request_id": 42,
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70",
"source_branch": "feat/run-header-stream",
"source_branch_deleted": false,
"source_branch_head": "fc9ff0ca521b8b75a819d4339fb111d0100bcffc",
"status": "open",
"target_branch": "main",
"target_branch_head": "6c0c110f7d1ec927fc7b47d5d022050f75ec723d",
"title": "Inline scalar newtypes but keep their brand",
"updated_at": "2026-10-12T17:41:43Z"
},
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70"
},
{
"closing": false,
"merge_request": {
"created_at": "2026-10-15T12:13:59Z",
"created_by": "c9d8e7f6-a5b4-4c3d-9e2f-1a0b9c8d7e6f",
"is_draft": false,
"merge_request_id": 42,
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70",
"source_branch": "feature/region-legend",
"source_branch_deleted": false,
"source_branch_head": "34df158ae3ab64c0b9bd2f5459b271b7db14b0ac",
"status": "open",
"target_branch": "main",
"target_branch_head": "a1674e0c13eeca1875e9f1cc0203e6550b70ec65",
"title": "Label every synthesized example",
"updated_at": "2026-10-08T09:50:13Z"
},
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70"
}
],
"next_token": "next-token-13b6"
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-9fed",
"message": "Inline scalar newtypes but keep their brand"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-9831",
"message": "Draw the region map from operation density"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-238e",
"message": "Stream pipeline status into the run header"
}
}
404Work item not foundapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-9f4e",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap issue-code-links list-issue-merge-requests

  • --repo-ididRepository ID (id or owner/repo path)
  • --issue-ididWork-item iid
  • --limitnumberoptionalPage size (default 20, max 100)
  • --next-tokenstringoptionalPagination cursor

Used in these guides