Create Ruleset Tool
create_ruleset_toolCreate GitHub rulesets for an organization or a single repository, defining enforcement, target refs, bypass actors, and rules to control branch, tag, or push behavior.
Instructions
Create a ruleset on an organization, or on one repository.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"org": "<org>",
"name": "<name>",
"enforcement": "<enforcement>"
},
"name": "create_ruleset_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Organization name (the repository owner when repo is given) | |
| name | Yes | Ruleset name | |
| repo | No | Repository name; omit for an organization ruleset | |
| rules | No | Rules, each {type, parameters} | |
| target | No | branch, tag, push, or repository (organization only) | branch |
| enforcement | Yes | disabled, active or evaluate (evaluate is Enterprise only) | |
| bypass_actors | No | Actors that may bypass the ruleset | |
| ref_name_exclude | No | Ref patterns to skip | |
| ref_name_include | No | Ref patterns (~DEFAULT_BRANCH and ~ALL allowed); required for branch and tag rulesets | |
| repository_name_exclude | No | Repository name patterns to skip | |
| repository_name_include | No | Repository name patterns (~ALL allowed); required for an organization ruleset, refused with repo | |
| repository_name_protected | No | Also match on rename protection |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||