Open Context Protocol is live! 🚀 Read the launch post
reposMergeUpstream

reposMergeUpstream

Sync a fork branch with the upstream repository

Details

  • Method: POST
  • Path: /repos/{owner}/{repo}/merge-upstream
  • Operation ID: repos/merge-upstream

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"
  },
  "branch": {
    "description": "The name of the branch which should be updated to match upstream.",
    "required": true,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "title": "Merged upstream",
  "description": "Results of a successful merge upstream request",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "merge_type": {
      "type": "string",
      "enum": [
        "merge",
        "fast-forward",
        "none"
      ]
    },
    "base_branch": {
      "type": "string"
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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