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

reposGetRepoRuleSuite

Get a repository rule suite

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}
  • Operation ID: repos/get-repo-rule-suite

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"
  },
  "rule_suite_id": {
    "description": "The unique identifier of the rule suite result.\nTo get this ID, you can use [GET /repos/{owner}/{repo}/rulesets/rule-suites](https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites)\nfor repositories and [GET /orgs/{org}/rulesets/rule-suites](https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites)\nfor organizations.",
    "required": true,
    "location": "path",
    "type": "integer"
  }
}

Response Schema

{
  "title": "Rule Suite",
  "description": "Response",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "The unique identifier of the rule insight."
    },
    "actor_id": {
      "type": "integer",
      "description": "The number that identifies the user.",
      "nullable": true
    },
    "actor_name": {
      "type": "string",
      "description": "The handle for the GitHub user account.",
      "nullable": true
    },
    "before_sha": {
      "type": "string",
      "description": "The previous commit SHA of the ref."
    },
    "after_sha": {
      "type": "string",
      "description": "The new commit SHA of the ref."
    },
    "ref": {
      "type": "string",
      "description": "The ref name that the evaluation ran on."
    },
    "repository_id": {
      "type": "integer",
      "description": "The ID of the repository associated with the rule evaluation."
    },
    "repository_name": {
      "type": "string",
      "description": "The name of the repository without the `.git` extension."
    },
    "pushed_at": {
      "type": "string",
      "format": "date-time",
      "example": "2011-01-26T19:06:43Z"
    },
    "result": {
      "type": "string",
      "enum": [
        "pass",
        "fail",
        "bypass"
      ],
      "description": "The result of the rule evaluations for rules with the `active` enforcement status."
    },
    "evaluation_result": {
      "type": "string",
      "nullable": true,
      "enum": [
        "pass",
        "fail",
        "bypass"
      ],
      "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run."
    },
    "rule_evaluations": {
      "type": "array",
      "description": "Details on the evaluated rules.",
      "items": {
        "type": "object",
        "properties": {
          "rule_source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "The type of rule source."
              },
              "id": {
                "type": "integer",
                "nullable": true,
                "description": "The ID of the rule source."
              },
              "name": {
                "type": "string",
                "nullable": true,
                "description": "The name of the rule source."
              }
            }
          },
          "enforcement": {
            "type": "string",
            "enum": [
              "active",
              "evaluate",
              "deleted ruleset"
            ],
            "description": "The enforcement level of this rule source."
          },
          "result": {
            "type": "string",
            "enum": [
              "pass",
              "fail"
            ],
            "description": "The result of the evaluation of the individual rule."
          },
          "rule_type": {
            "type": "string",
            "description": "The type of rule."
          },
          "details": {
            "type": "string",
            "nullable": true,
            "description": "The detailed failure message for the rule. Null if the rule passed."
          }
        }
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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