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

codespacesRepoMachinesForAuthenticatedUser

List available machine types for a repository

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/codespaces/machines
  • Operation ID: codespaces/repo-machines-for-authenticated-user

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"
  },
  "location": {
    "description": "The location to check for available machines. Assigned by IP if not provided.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "client_ip": {
    "description": "IP for location auto-detection when proxying a request",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "ref": {
    "description": "The branch or commit to check for prebuild availability and devcontainer restrictions.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "required": [
    "total_count",
    "machines"
  ],
  "properties": {
    "total_count": {
      "type": "integer"
    },
    "machines": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Codespace machine",
        "description": "A description of the machine powering a codespace.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the machine.",
            "example": "standardLinux"
          },
          "display_name": {
            "type": "string",
            "description": "The display name of the machine includes cores, memory, and storage.",
            "example": "4 cores, 16 GB RAM, 64 GB storage"
          },
          "operating_system": {
            "type": "string",
            "description": "The operating system of the machine.",
            "example": "linux"
          },
          "storage_in_bytes": {
            "type": "integer",
            "description": "How much storage is available to the codespace.",
            "example": 68719476736
          },
          "memory_in_bytes": {
            "type": "integer",
            "description": "How much memory is available to the codespace.",
            "example": 17179869184
          },
          "cpus": {
            "type": "integer",
            "description": "How many cores are available to the codespace.",
            "example": 4
          },
          "prebuild_availability": {
            "type": "string",
            "description": "Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be \"null\" if prebuilds are not supported or prebuild availability could not be determined. Value will be \"none\" if no prebuild is available. Latest values \"ready\" and \"in_progress\" indicate the prebuild availability status.",
            "example": "ready",
            "enum": [
              "none",
              "ready",
              "in_progress"
            ],
            "nullable": true
          }
        },
        "required": [
          "name",
          "display_name",
          "operating_system",
          "storage_in_bytes",
          "memory_in_bytes",
          "cpus",
          "prebuild_availability"
        ]
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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