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

reposGetRepoRulesetVersion

Get repository ruleset version

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}
  • Operation ID: repos/get-repo-ruleset-version

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"
  },
  "ruleset_id": {
    "description": "The ID of the ruleset.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "version_id": {
    "description": "The ID of the version",
    "required": true,
    "location": "path",
    "type": "integer"
  }
}

Response Schema

{
  "allOf": [
    {
      "title": "Ruleset version",
      "type": "object",
      "description": "The historical version of a ruleset",
      "required": [
        "version_id",
        "actor",
        "updated_at"
      ],
      "properties": {
        "version_id": {
          "type": "integer",
          "description": "The ID of the previous version of the ruleset"
        },
        "actor": {
          "type": "object",
          "description": "The actor who updated the ruleset",
          "properties": {
            "id": {
              "type": "integer"
            },
            "type": {
              "type": "string"
            }
          }
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "type": "object",
          "description": "The state of the ruleset version"
        }
      }
    }
  ]
}

Usage

from ocp_agent import OCPAgent

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

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