Get exact Git reference
gh_get_refGet a single Git ref (branch or tag) from a GitHub repository.
Instructions
Read-only: resolve one exact branch or tag reference path such as heads/main or tags/v1.0.0. This tool never performs matching-reference or prefix discovery. Annotated tag objects retain their tag-object identity and are peeled through bounded exact tag-object reads to a commit when applicable.
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": {
"owner": "<owner>",
"repo": "<repo>",
"ref": "<ref>"
},
"name": "gh_get_ref"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | One exact Git ref path relative to refs/, formatted as heads/<branch> or tags/<tag>. Do not pass refs/, a bare branch/tag name, or a matching prefix. | |
| repo | Yes | GitHub repository name without the owner prefix. | |
| owner | Yes | GitHub repository owner or organization login. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| found | Yes | ||
| object_sha | No | ||
| object_url | No | ||
| object_type | No | ||
| peeled_commit_sha | No |