Open Context Protocol is live! 🚀 Read the launch post

pullsMerge

Merge a pull request

Details

  • Method: PUT
  • Path: /repos/{owner}/{repo}/pulls/{pull_number}/merge
  • Operation ID: pulls/merge

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "pull_number": {
    "description": "The number that identifies the pull request.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "commit_title": {
    "description": "Title for the automatic commit message.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "commit_message": {
    "description": "Extra detail to append to automatic commit message.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "sha": {
    "description": "SHA that pull request head must match to allow merge.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "merge_method": {
    "description": "The merge method to use.",
    "required": false,
    "location": "body",
    "type": "string",
    "enum": [
      "merge",
      "squash",
      "rebase"
    ]
  }
}

Response Schema

{
  "title": "Pull Request Merge Result",
  "description": "Pull Request Merge Result",
  "type": "object",
  "properties": {
    "sha": {
      "type": "string"
    },
    "merged": {
      "type": "boolean"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "merged",
    "message",
    "sha"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('pullsMerge', {
    # Add required parameters here
})