Get file or directory contents
get_file_contentsRead a file from a Forgejo/Gitea repository as text or list directory contents; an empty path lists the repo root, and file reads return the blob SHA needed for updates.
Instructions
Read a file (decoded to text) or list a directory. Use path '' for the repository root. File results include the blob sha needed to update the file.
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>"
},
"name": "get_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or commit SHA (default: repo default branch) | |
| path | No | ||
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or organization) |