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

reposGetRepoRuleSuites

List repository rule suites

Details

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

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"
  },
  "ref": {
    "description": "The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "time_period": {
    "description": "The time period to filter by.\n\nFor example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for rule suites that occurred in the past 7 days (168 hours).",
    "required": false,
    "location": "query",
    "type": "string",
    "enum": [
      "hour",
      "day",
      "week",
      "month"
    ]
  },
  "actor_name": {
    "description": "The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "rule_suite_result": {
    "description": "The rule suite results to filter on. When specified, only suites with this result will be returned.",
    "required": false,
    "location": "query",
    "type": "string",
    "enum": [
      "pass",
      "fail",
      "bypass",
      "all"
    ]
  },
  "per_page": {
    "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "page": {
    "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  }
}

Response Schema

{
  "title": "Rule Suites",
  "description": "Response",
  "type": "array",
  "items": {
    "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."
      },
      "actor_name": {
        "type": "string",
        "description": "The handle for the GitHub user account."
      },
      "before_sha": {
        "type": "string",
        "description": "The first commit sha before the push evaluation."
      },
      "after_sha": {
        "type": "string",
        "description": "The last commit sha in the push evaluation."
      },
      "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",
        "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`."
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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