read_file
Retrieve a file's content from a Gitea repository. Decodes text files to UTF-8 and flags binary files, while preserving the original base64 encoding and SHA for potential updates.
Instructions
Read a file's content from a Gitea repository.
Returns Gitea's ContentsResponse shape extended with a text field
containing the decoded file content as a UTF-8 string (or None if the
content isn't valid UTF-8 — binary file). The raw base64 content and
Gitea's encoding are preserved so callers can re-decode if needed.
The sha field in the response is what :func:commit_changes would
need to update this file — but commit_changes fetches it internally,
so callers don't usually need to pass it forward.
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>",
"path": "<path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner | |
| repo | Yes | Repository name | |
| path | Yes | Path within the repository, e.g. 'src/gitea_mcp/server.py' | |
| ref | No | Branch name, tag name, or commit SHA to read from. Omit to read from the repository's default branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||