Open Context Protocol is live! 🚀 Read the launch post

gitGetCommit

Get a commit object

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/git/commits/{commit_sha}
  • Operation ID: git/get-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

{
  "title": "Git Commit",
  "description": "Low-level Git commit operations within a repository",
  "type": "object",
  "properties": {
    "sha": {
      "description": "SHA for the commit",
      "example": "7638417db6d59f3c431d3e1f261cc637155684cd",
      "type": "string"
    },
    "node_id": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "author": {
      "description": "Identifying information for the git-user",
      "type": "object",
      "properties": {
        "date": {
          "description": "Timestamp of the commit",
          "example": "2014-08-09T08:02:04+12:00",
          "format": "date-time",
          "type": "string"
        },
        "email": {
          "type": "string",
          "description": "Git email address of the user",
          "example": "monalisa.octocat@example.com"
        },
        "name": {
          "description": "Name of the git user",
          "example": "Monalisa Octocat",
          "type": "string"
        }
      },
      "required": [
        "email",
        "name",
        "date"
      ]
    },
    "committer": {
      "description": "Identifying information for the git-user",
      "type": "object",
      "properties": {
        "date": {
          "description": "Timestamp of the commit",
          "example": "2014-08-09T08:02:04+12:00",
          "format": "date-time",
          "type": "string"
        },
        "email": {
          "type": "string",
          "description": "Git email address of the user",
          "example": "monalisa.octocat@example.com"
        },
        "name": {
          "description": "Name of the git user",
          "example": "Monalisa Octocat",
          "type": "string"
        }
      },
      "required": [
        "email",
        "name",
        "date"
      ]
    },
    "message": {
      "description": "Message describing the purpose of the commit",
      "example": "Fix #42",
      "type": "string"
    },
    "tree": {
      "type": "object",
      "properties": {
        "sha": {
          "description": "SHA for the commit",
          "example": "7638417db6d59f3c431d3e1f261cc637155684cd",
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "sha",
        "url"
      ]
    },
    "parents": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sha": {
            "description": "SHA for the commit",
            "example": "7638417db6d59f3c431d3e1f261cc637155684cd",
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "html_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "sha",
          "url",
          "html_url"
        ]
      }
    },
    "verification": {
      "type": "object",
      "properties": {
        "verified": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "signature": {
          "type": "string",
          "nullable": true
        },
        "payload": {
          "type": "string",
          "nullable": true
        },
        "verified_at": {
          "type": "string",
          "nullable": true
        }
      },
      "required": [
        "verified",
        "reason",
        "signature",
        "payload",
        "verified_at"
      ]
    },
    "html_url": {
      "type": "string",
      "format": "uri"
    }
  },
  "required": [
    "sha",
    "node_id",
    "url",
    "html_url",
    "author",
    "committer",
    "tree",
    "message",
    "parents",
    "verification"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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