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

reposListBranchesForHeadCommit

List branches for HEAD commit

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head
  • Operation ID: repos/list-branches-for-head-commit

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"
  },
  "commit_sha": {
    "description": "The SHA of the commit.",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "type": "array",
  "items": {
    "title": "Branch Short",
    "description": "Branch Short",
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      },
      "commit": {
        "type": "object",
        "properties": {
          "sha": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "sha",
          "url"
        ]
      },
      "protected": {
        "type": "boolean"
      }
    },
    "required": [
      "name",
      "commit",
      "protected"
    ]
  }
}

Usage

from ocp_agent import OCPAgent

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

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