Open Context Protocol is live! 🚀 Read the launch post

gitGetBlob

Get a blob

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/git/blobs/{file_sha}
  • Operation ID: git/get-blob

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"
  },
  "file_sha": {
    "description": "",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "title": "Blob",
  "description": "Blob",
  "type": "object",
  "properties": {
    "content": {
      "type": "string"
    },
    "encoding": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "sha": {
      "type": "string"
    },
    "size": {
      "type": "integer",
      "nullable": true
    },
    "node_id": {
      "type": "string"
    },
    "highlighted_content": {
      "type": "string"
    }
  },
  "required": [
    "sha",
    "url",
    "node_id",
    "size",
    "content",
    "encoding"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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