Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GITEA_TOKENYesGitea API access token
GITEA_BASE_URLYesGitea instance URL (e.g. https://gitea.example.com)
GITEA_DEFAULT_REPONoDefault repository name (avoid passing repo on every call)
GITEA_DEFAULT_OWNERNoDefault repository owner (avoid passing owner on every call)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_issues

List issues in one Gitea repository. Paginated: page is 1-based, limit <= 100; keep paging until a page returns fewer than limit. Filters: state (default open), labels (comma-separated NAMES). RISK: Gitea may include pull requests here; to list only issues use search_issues with type='issues'. Example: list_issues({ state: 'open', page: 1, limit: 50 })

get_issue

Fetch one issue by its index — the number shown in the issue URL (e.g. #42), NOT the internal id. Use to read the full body, labels, assignee, or milestone of a single issue.

create_issue

Create an issue. title is required. labels takes label IDs (numbers) — call list_labels first to map names to IDs, or add labels by name after creation via add_issue_labels. assignees is an array of usernames. Returns the created issue including its number.

update_issue

Update one issue by index (PATCH: only provided fields change). RISK: passing labels REPLACES the entire label set (give the full desired ID list) — to change a single label use add_issue_labels/remove_issue_label instead. state is 'open' or 'closed'; set milestone by ID.

delete_issue

PERMANENTLY delete an issue by index. IRREVERSIBLE (no recycle bin) and may fail if the instance disallows deletion. Confirm the index with the user first; prefer update_issue({ state: 'closed' }) to close instead of delete.

search_issues

Search issues (and pull requests) across ALL repositories the token can see, by keyword/type/state/labels. Use for 'find issues about X' or duplicate detection across repos; set type='issues' to exclude pull requests. For listing one repo's issues use list_issues instead.

list_comments

List comments on one issue by its index. RISK: returns only the server's DEFAULT first page (this tool exposes no pagination), so long threads may be TRUNCATED — do not assume a short list means few comments. Gitea returns oldest-first. Each comment has an id (used to update/delete it), body (Markdown), user, and timestamps.

create_comment

Add a comment to an issue by its index. body is required and supports Markdown. Returns the comment including its id — retain it to later update_comment/delete_comment that exact comment.

update_comment

Edit a comment by its id (NOT the issue index — get the id from list_comments). body is the full replacement Markdown. Only the comment author or a repo admin may edit (403 otherwise).

delete_comment

Delete a comment by its id (NOT the issue index — get the id from list_comments). IRREVERSIBLE. Confirm with the user first; only the author or a repo admin may delete (403 otherwise).

list_labels

List labels in a repo. Paginated (page 1-based, limit <= 100); page until a page returns fewer than limit. Each label has id (number), name, color (hex), description. ALWAYS call this before any label mutation — label endpoints mix names and ids (add/replace use NAMES, remove/update/delete use IDS).

create_label

Create a label. name required and MUST be unique in the repo (a duplicate -> conflict error). color is 6-digit hex, with or without a leading '#' (e.g. '#ff0000' or 'ff0000'). description optional. Returns the label with its id.

update_label

Update a label by id (number — NOT the name). Provide any of name/color/description (PATCH semantics). color is 6-digit hex. Get the id from list_labels.

delete_labelA

Permanently delete a label by id (number — NOT the name). IRREVERSIBLE and also removes it from EVERY issue that currently has it. Get the id from list_labels and confirm with the user before deleting.

add_issue_labels

Add labels to an issue by its index. labels is an array of label NAMES (strings) — NOT ids. Get valid names from list_labels; a name that does not exist errors (404). ADDITIVE: existing labels are kept.

remove_issue_label

Remove ONE label from an issue. Takes the label id (number) — NOT the name. Get the id from list_labels (issue labels carry their id). Errors if the label is not currently on the issue.

replace_issue_labels

REPLACE the issue's ENTIRE label set. labels is an array of label NAMES. Every existing label is removed and ONLY the listed ones remain. Read current labels first if any must survive; confirm with the user before replacing.

clear_issue_labels

Remove ALL labels from an issue by its index. Destructive for that issue's labels. Confirm with the user first; if a known subset must remain, use replace_issue_labels with that subset instead.

list_milestones

List milestones in a repo. Paginated (page 1-based, limit <= 100). RISK: Gitea's DEFAULT returns only OPEN milestones — pass state='all' or 'closed' if you need closed/completed ones. Each milestone has id, title, state, open_issues, closed_issues, due_on.

get_milestone

Fetch one milestone by id (the internal id from list_milestones, NOT the title). Returns progress counts (open_issues / closed_issues), description, state, and due_on.

create_milestone

Create a milestone. title required. description optional. due_on optional ISO 8601 (e.g. '2025-12-31T23:59:59Z'). New milestones start in state 'open'. Returns the milestone with its id.

update_milestone

Update a milestone by id (PATCH: only provided fields change). Provide any of title/description/due_on/state. state is 'open' or 'closed'. NOTE: closing a milestone does NOT close its open issues (they stay open, merely ungrouped) — close the issues separately if required.

delete_milestone

Permanently delete a milestone by id. IRREVERSIBLE. Issues assigned to it are NOT deleted — they keep existing but lose the milestone assignment (milestone becomes null). Confirm with the user first; prefer update_milestone({ state: 'closed' }) to preserve history.

list_topics

List a repository's topics (tags). Returns the topic name list for the repo — useful to inspect classification before editing. Topic names are lowercase letters, digits, and hyphens. Paginated (page 1-based, limit <= 100).

replace_topics

REPLACE a repository's ENTIRE topic set. topics is the full list of topic names that should remain after the call — every existing topic not listed is removed. Pass an empty array to clear all topics. Topic names: lowercase letters, digits, and hyphens, starting with a letter/digit. Read current topics with list_topics first if any must survive; confirm with the user before replacing.

add_topic

Add ONE topic to a repository by name. Idempotent: adding an existing topic does not error. Topic name: lowercase letters, digits, and hyphens, starting with a letter/digit. To add several topics at once or to set the exact desired set, prefer replace_topics.

remove_topic

Remove ONE topic from a repository by name. No error if the topic is not currently on the repo (idempotent delete). Topic name: lowercase letters, digits, and hyphens, starting with a letter/digit. Confirm with the user first.

list_pull_requests

List pull requests in one Gitea repository. Paginated: page is 1-based, limit <= 100; keep paging until a page returns fewer than limit. Filters: state (default open), labels (comma-separated NAMES), sort, milestone. Example: list_pull_requests({ state: 'open', page: 1, limit: 50 }). Cross-repo PR search uses search_issues({ type: 'pulls' }).

get_pull_request

Fetch one pull request by its index — the number shown in the PR URL (e.g. #42), NOT the internal id. Returns the full PR including base/head branches, mergeable status, merged flag, labels, and milestone.

create_pull_request

Create a pull request. title, head (source branch), and base (target branch) are required. For cross-fork PRs use 'owner:branch' in head. labels takes label IDs (numbers) — call list_labels first. Prefix the title with WIP: or [WIP] to prevent accidental merge while work is in progress. Returns the created PR including its number.

update_pull_request

Update one pull request by index (PATCH: only provided fields change). Set state to 'closed' to close a PR WITHOUT merging (reopens with 'open'). RISK: passing labels REPLACES the entire label set (give the full desired ID list); base retargets the PR and is rarely reversible. To change a single label use add_issue_labels/remove_issue_label (PR #N == Issue #N — label endpoints are shared).

merge_pull_request

Merge a pull request by index. Do selects the strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase + fast-forward), 'rebase-merge' (rebase + merge commit). Optional MergeTitleField/MergeMessageField customize the merge commit; SHA guards against branch drift. IRREVERSIBLE — confirm the index, strategy, and that the PR is mergeable (get_pull_request mergeable: true) with the user BEFORE merging. Check is_pull_merged first if unsure.

is_pull_merged

Check whether a pull request has been merged. Returns a boolean (true = merged, false = not merged). Call before merge_pull_request to avoid a redundant attempt, or to confirm a PR's final state.

list_pull_commits

List the commits in one pull request by its index. Paginated (page 1-based, limit <= 100). Each entry has sha, html_url, the commit message, and an optional author. Useful for reviewing what a PR changes before merging.

list_pull_files

List the files changed in one pull request by its index. Paginated (page 1-based, limit <= 100). Each entry has filename, status (added/modified/deleted/renamed), additions, deletions, changes, and html_url. Use to understand a PR's diff scope before reviewing or merging.

list_action_runs

List Gitea Actions workflow runs in one repository. Paginated: page is 1-based, limit <= 100; keep paging until a page returns fewer than limit. Filters: branch, event (push, pull_request, schedule, etc.), status (pending, queued, waiting, in_progress, running, success, failure, skipped, cancelled), actor (username that triggered the run), head_sha. The response is a wrapper object { workflow_runs: [...], count: number } — the runs live under the workflow_runs key, NOT at the top level. Use this to find a run's id before calling get_action_run, cancel_action_run, or rerun_action_run.

get_action_run

Fetch one Actions workflow run by its runId (the numeric run ID from list_action_runs or the Gitea web UI — NOT the workflow name or index). Returns the full run including status, conclusion, head_branch, head_sha, event, started_at, completed_at, and actor. Call this BEFORE cancel_action_run (to verify the run is still active) or rerun_action_run (to verify it has completed and is rerunnable).

cancel_action_run

Cancel one Actions workflow run by runId. Only valid on runs that are still ACTIVE (status: queued, waiting, in_progress, running, pending) — cancelling an already-completed run returns an error. PARTIALLY DESTRUCTIVE: active jobs are killed and their partial results are discarded. ALWAYS call get_action_run first to confirm the run is still active, and confirm the runId with the user before cancelling. The run's conclusion becomes 'cancelled' after a successful cancel.

rerun_action_run

Rerun an entire Actions workflow run by runId. Only valid on runs that have COMPLETED (status: success, failure, cancelled, skipped) — rerunning an active run returns an error. Requires Gitea 1.26.0+. Creates a NEW run (incrementing run_attempt); the original run is not modified. ALWAYS call get_action_run first to confirm the run has completed, and confirm the runId with the user before rerunning. To rerun ONLY the failed jobs instead of the whole run, use rerun_action_run_failed_jobs.

rerun_action_run_failed_jobsA

Rerun ONLY the failed jobs of an Actions workflow run by runId. More efficient than rerun_action_run when most jobs succeeded and only a subset failed. Only valid on completed runs. Requires Gitea 1.26.0+. ALWAYS call get_action_run first to confirm the run has completed and has failed jobs (conclusion: failure), and confirm the runId with the user before rerunning.

resolve_repo

Detect baseUrl/owner/repo from a git repository's remotes (SSH or HTTPS). Reads upstream first, then origin, then any other remote; all discovered remotes are returned. path defaults to the current directory. Call ONCE at the start of a session to establish owner/repo for later calls instead of guessing. Errors if no parseable remote is found.

list_my_repos

List repositories the authenticated token's user can access (across ALL owners/orgs). Paginated (page 1-based, limit <= 100). Each repo object is large — keep limit modest. Use to DISCOVER owner/repo values or find where to work, not to list one repo's issues.

gitea_statusA

Report the resolved credential state: every discovered credential candidate, its source (gitea-config / env / credential-store), the auth schemes that will be tried, and per-scheme outcome (pending / active / exhausted with redacted last error). Secrets are NEVER returned — only a secretPresent boolean and a masked username (firstChar***). Use this when a tool returns 401/403 to see which schemes were rejected and which candidate (if any) is currently active. Takes no input.

Prompts

Interactive templates invoked by user choice

NameDescription
triage_issuesList open issues in a repo, read context on ambiguous ones, and propose priority labels + next actions. Returns an instruction the model executes via the tools.
summarize_issueRead one issue plus its comment thread and produce a concise status: decisions, open questions, and a recommended next action.
audit_labelsList every label in a repo and report duplicates, inconsistent colors, missing descriptions, and a proposed cleanup. Read-only analysis; applies nothing.
milestone_reportList all milestones in a repo, compute completion % for each, and flag overdue milestones that still have open issues. Read-only.
triage_pull_requestsList open pull requests in a repo, inspect high-priority ones (commits, files, mergeability), and propose review/merge/close actions. Returns an instruction the model executes via the tools.
summarize_pull_requestRead one pull request (body, commits, changed files, comment thread) and produce a concise review summary: what it changes, mergeability, open questions, and a recommended action (merge / request changes / close).
triage_action_runsList recent Gitea Actions workflow runs in a repo, identify stuck/failed/running ones, and propose cancel or rerun actions. Returns an instruction the model executes via the tools.

Resources

Contextual data attached and managed by the client

NameDescription
field-referenceGitea object field reference (Issue, Label, Milestone, Comment, Repo, User)
label-guideLabel management guide: name-vs-id matrix, conventions, safe/unsafe operations
tool-cookbookTask-to-tool recipes: discover, read, create, edit, destructive ops, pagination, errors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amonstack/gitea_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server