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

codespacesGetRepoPublicKey

Get a repository public key

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/codespaces/secrets/public-key
  • Operation ID: codespaces/get-repo-public-key

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"
  }
}

Response Schema

{
  "title": "CodespacesPublicKey",
  "description": "The public key used for setting Codespaces secrets.",
  "type": "object",
  "properties": {
    "key_id": {
      "description": "The identifier for the key.",
      "type": "string",
      "example": "1234567"
    },
    "key": {
      "description": "The Base64 encoded public key.",
      "type": "string",
      "example": "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs="
    },
    "id": {
      "type": "integer",
      "example": 2
    },
    "url": {
      "type": "string",
      "example": "https://api.github.com/user/keys/2"
    },
    "title": {
      "type": "string",
      "example": "ssh-rsa AAAAB3NzaC1yc2EAAA"
    },
    "created_at": {
      "type": "string",
      "example": "2011-01-26T19:01:12Z"
    }
  },
  "required": [
    "key_id",
    "key"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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