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

actionsGetArtifact

Get an artifact

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/actions/artifacts/{artifact_id}
  • Operation ID: actions/get-artifact

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"
  },
  "artifact_id": {
    "description": "The unique identifier of the artifact.",
    "required": true,
    "location": "path",
    "type": "integer"
  }
}

Response Schema

{
  "title": "Artifact",
  "description": "An artifact",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "example": 5
    },
    "node_id": {
      "type": "string",
      "example": "MDEwOkNoZWNrU3VpdGU1"
    },
    "name": {
      "description": "The name of the artifact.",
      "type": "string",
      "example": "AdventureWorks.Framework"
    },
    "size_in_bytes": {
      "description": "The size in bytes of the artifact.",
      "type": "integer",
      "example": 12345
    },
    "url": {
      "type": "string",
      "example": "https://api.github.com/repos/github/hello-world/actions/artifacts/5"
    },
    "archive_download_url": {
      "type": "string",
      "example": "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip"
    },
    "expired": {
      "description": "Whether or not the artifact has expired.",
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "digest": {
      "type": "string",
      "description": "The SHA256 digest of the artifact. This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. For older versions, this field will be null.",
      "nullable": true,
      "example": "sha256:cfc3236bdad15b5898bca8408945c9e19e1917da8704adc20eaa618444290a8c"
    },
    "workflow_run": {
      "type": "object",
      "nullable": true,
      "properties": {
        "id": {
          "example": 10,
          "type": "integer"
        },
        "repository_id": {
          "example": 42,
          "type": "integer"
        },
        "head_repository_id": {
          "example": 42,
          "type": "integer"
        },
        "head_branch": {
          "example": "main",
          "type": "string"
        },
        "head_sha": {
          "example": "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d",
          "type": "string"
        }
      }
    }
  },
  "required": [
    "id",
    "node_id",
    "name",
    "size_in_bytes",
    "url",
    "archive_download_url",
    "expired",
    "created_at",
    "expires_at",
    "updated_at"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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