Skip to main content
Glama

gitea_action

Interact with a self-hosted Gitea forge REST API to read and edit repositories, branches, files, commits, pull requests, issues, workflow runs, and push mirrors.

Instructions

Interact with the self-hosted Gitea forge REST API: read repos, branches, files, and commits, read Forge Actions runs, jobs, and job logs (to find why a check failed), create branches, single-file commits, and literal find/replace edits to part of a file, open/read/merge/close pull requests, comment, manage issues, and manage push mirrors so the forge owns downstream syncs (for example a calm scheduled mirror to GitHub). To run a few test files on a branch without waiting on full CI: create_test_run(owner, repo, ref, files) dispatches .gitea/workflows/quick-test.yml and returns its run id (each dispatch gets its own request_id, even when you pass one as a label, so concurrent runs never get mixed up). Then get_test_results(owner, repo, run_id) polls status, conclusion, and the last 80 log lines; pass request_id instead of run_id if create_test_run reported the run was not visible yet.

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag, or commit for get_file, get_commit_status, or create_test_run (the branch/sha to check out and test).
shaNoCommit SHA for get_commit.
baseNoPull request base branch.
bodyNoIssue, pull request, or comment body text.
headNoPull request head branch.
pageNoPage number.
pathNoRepo-relative file path for get_file, upsert_file, and write_file_edits.
repoNoRepository name.
editsNowrite_file_edits: 1 to 50 { find, replace } edits, applied in order as literal text (never a regex; a "$" in replace is inserted literally). Each find is matched against the file as last read (after any earlier edits in this same call already applied) and must match exactly once, or the whole call is refused before anything is written.
filesNocreate_test_run: test file paths to run, as an array or a space-separated string (each *.test.ts, *.test.tsx or *.test.mjs; at most 20).
indexNoIssue or pull request number (Gitea's own field name). Synonym for issue_number/pull_number/number on comment_issue_or_pr, merge_pull_request, close_pull_request, get_pull_request, and get_pull_request_files.
limitNolist_action_runs (or list_workflow_runs): runs to return (default 20, max 50).
ownerNoRepository owner login.
queryNoSearch query string (for search_repos).
stateNoFilter by state: open, closed, all.
titleNoIssue or pull request title.
actionYesAction: get_version, search_repos, get_repo, list_branches, create_branch, get_file, get_commit_status, get_commit, list_action_runs, list_workflow_runs (alias of list_action_runs), list_run_jobs, get_job_log, create_test_run (dispatch quick-test.yml on a branch), get_test_results (poll a create_test_run run), upsert_file (replace a whole file's contents), write_file_edits (change part of a file: 1-50 literal find/replace edits, each find must match exactly once; aliases patch_file, replace_in_file, str_replace), list_issues, create_issue, comment_issue_or_pr, comment (alias of comment_issue_or_pr), list_prs, get_pull_request, get_pull_request_files, create_pr (alias of create_pull_request), create_pull_request, merge_pull_request, close_pull_request, get_user, list_push_mirrors, add_push_mirror, delete_push_mirror, sync_push_mirrors.
branchNoTarget branch for branch creation, upsert_file, or pull requests; list_action_runs branch filter. Required for write_file_edits.
job_idNoget_job_log: Forge Actions job id (from list_run_jobs).
numberNoIssue or pull request number fallback.
run_idNolist_run_jobs, get_test_results: Forge Actions run id (from list_action_runs or create_test_run).
statusNolist_action_runs (or list_workflow_runs): filter runs by status, for example queued, in_progress, success, failure.
api_keyNoGitea token fallback. Saved UnClick Gitea login is preferred when omitted.
commentNoComment body fallback for comment_issue_or_pr.
contentNoUTF-8 file content for upsert_file (replaces the whole file).
messageNoCommit message for upsert_file or write_file_edits.
base_urlNoForge base URL, for example https://git.unclick.world or http://localhost:3300. Saved UnClick Gitea login or GITEA_BASE_URL is used when omitted.
end_lineNoget_file: last line to return (inclusive). Omit for end of file; the byte cap may trim earlier (truncated: true + next_start_line).
head_shaNolist_action_runs (or list_workflow_runs): only runs for this commit sha.
intervalNoPush mirror sync interval, for example 1h0m0s. Defaults to 8h0m0s.
per_pageNoResults per page (max 50).
usernameNoGitea username (for get_user).
max_bytesNoget_file: response size cap in bytes (default 10000, clamped 256-100000). Slices always end on whole lines.
expect_shaNowrite_file_edits: optional. Refuse with no write if the file's current sha does not match this (the sha the seat last read the file at).
new_branchNoNew branch name for create_branch, or the branch upsert_file should create.
request_idNocreate_test_run: optional label for this run; the tool always adds a unique suffix (or makes a random UUID when omitted) and returns the full request_id, so a reused label never matches an older run. get_test_results: the full request_id create_test_run returned, as an alternative to run_id, for polling a run that was not visible yet right after dispatch.
start_lineNoget_file: first line to return (1-based, default 1). Every response reports total_lines, total_bytes, truncated, and next_start_line so you can walk a big file in slices.
tail_linesNoget_job_log: trailing log lines to return (default 200, max 2000). Output is capped near 60,000 characters and secrets are redacted.
base_branchNoBase branch for create_branch or pull requests. Defaults to main.
errors_onlyNoget_job_log: return only the matched error lines (no tail). Defaults to false.
mirror_nameNoMirror remote_name for delete_push_mirror (from list_push_mirrors).
pull_numberNoPull request number for comment_issue_or_pr, merge_pull_request, close_pull_request, get_pull_request, or get_pull_request_files.
access_tokenNoGitea access token. Saved UnClick Gitea login is used when this is omitted.
commit_titleNoMerge commit title.
issue_numberNoIssue number for comment_issue_or_pr.
merge_methodNoMerge method: merge, squash, rebase, or rebase-merge. Defaults to squash.
delete_branchNoDelete the head branch after merging. Defaults to false.
commit_messageNoMerge commit message.
remote_addressNoDownstream clone URL for add_push_mirror, for example https://github.com/owner/repo.git.
sync_on_commitNoSync the push mirror on every commit. Defaults to false to keep downstream activity calm.
remote_passwordNoToken or password for the push mirror remote.
remote_usernameNoUsername for the push mirror remote.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden, and it does disclose useful operational traits: every create_test_run dispatch gets a unique request_id suffix so concurrent runs never collide, and get_test_results returns status, conclusion, and the last 80 log lines. However, for a tool that merges PRs, deletes mirrors, and writes files, it says nothing about auth requirements, permission scopes, whether destructive actions are reversible, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The second paragraph is tight and front-loads the test workflow with a clear purpose. The first paragraph is a long, comma-chained enumeration that substantially duplicates the action enum's own description, so a meaningful share of the text is redundant rather than additive.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a 52-parameter dispatcher with no output schema and no annotations, the description covers the highest-friction flow (test dispatch/polling) well and states the overall scope. It leaves gaps an agent would care about: which parameters pair with which actions outside the test path, return shapes for read operations, and the consequences of the mutating actions (merge, close, delete_push_mirror). The rich schema compensates partially, but not fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter guidance the schema cannot: it shows the create_test_run(owner, repo, ref, files) call shape and the get_test_results(owner, repo, run_id) counterpart, and explains the run_id vs request_id substitution. This ties otherwise-scattered parameters into a usable workflow, though it does not clarify parameter applicability for the remaining actions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Interact with the self-hosted Gitea forge REST API') and enumerates the concrete capability groups (repos, branches, files, commits, Forge Actions runs/jobs/logs, branches/commits, PRs, issues, push mirrors). The 'self-hosted Gitea' qualifier distinguishes it from sibling GitHub/GitLab/Bitbucket tools, so an agent can tell what this tool addresses without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance for one sub-flow: create_test_run plus get_test_results is for running a few test files without waiting on full CI, and it explains passing request_id when a run is not yet visible. It also justifies push mirrors as the mechanism for downstream sync. But it offers no when/when-not guidance or alternatives for the 30+ other actions, leaving most selection to the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools