Skip to content

Repository Tools

File browsing, commits, branches, tags, and repository management.

Tools Overview

ToolTypePurpose
browse_filesQueryDirectory tree and file content
manage_filesCommandCreate, update, upload files
browse_commitsQueryCommit history, details, diffs
browse_refsQueryBranches, tags, protection rules
manage_refCommandCreate/delete/protect branches and tags
browse_releasesQueryRelease history and assets
manage_releaseCommandCreate releases with assets

Files

browse_files

ActionDescription
treeList files and folders in a directory
contentRead file contents
download_attachmentDownload a file attachment from issues/MRs
json
{
  "action": "tree",
  "project_id": "my-org/api",
  "path": "src/services",
  "recursive": false,
  "per_page": 50
}
json
{
  "action": "content",
  "project_id": "my-org/api",
  "file_path": "src/config.ts",
  "ref": "main"
}
json
{
  "action": "tree",
  "project_id": "my-org/api",
  "path": "",
  "recursive": true,
  "per_page": 100
}

manage_files

ActionDescription
singleCreate or update a single file
batchCommit multiple files atomically
uploadUpload a file as markdown attachment
json
{
  "action": "single",
  "project_id": "my-org/api",
  "file_path": "src/new-feature.ts",
  "content": "export function newFeature() {\n  return true;\n}",
  "commit_message": "feat: add new feature module",
  "branch": "feature/new"
}
json
{
  "action": "batch",
  "project_id": "my-org/api",
  "branch": "feature/new",
  "commit_message": "feat: add service module",
  "files": [
    {
      "file_path": "src/service/index.ts",
      "content": "export { Service } from './service';"
    },
    {
      "file_path": "src/service/service.ts",
      "content": "export class Service {}"
    }
  ]
}

Commits

browse_commits

ActionDescription
listBrowse commit history
getRetrieve commit details
diffGet code changes in a commit
json
{
  "action": "list",
  "project_id": "my-org/api",
  "ref_name": "main",
  "per_page": 10
}
json
{
  "action": "list",
  "project_id": "my-org/api",
  "author": "[email protected]",
  "since": "2025-01-01T00:00:00Z",
  "per_page": 20
}
json
{
  "action": "diff",
  "project_id": "my-org/api",
  "sha": "abc1234",
  "per_page": 20
}

Commit Filters

ParameterDescription
ref_nameBranch or tag to list commits from
authorFilter by author name or email
since / untilDate range (ISO 8601)
pathOnly commits affecting this file/directory
allInclude commits from all branches

Branches & Tags

browse_refs

ActionDescription
list_branchesList all repository branches with optional search
get_branchGet details of a specific branch
list_tagsList all repository tags
get_tagGet details of a specific tag
list_protected_branchesList all protected branches with their protection rules
get_protected_branchGet protection rules for a specific branch
list_protected_tagsList all protected tags with their protection rules
json
{
  "action": "list_branches",
  "project_id": "my-org/api",
  "search": "feature/"
}
json
{
  "action": "list_tags",
  "project_id": "my-org/api",
  "order_by": "version",
  "sort": "desc"
}
json
{
  "action": "list_protected_branches",
  "project_id": "my-org/api"
}

manage_ref

ActionDescription
create_branchCreate a new branch from an existing ref
delete_branchDelete a branch from the repository
protect_branchAdd protection rules to a branch or pattern
unprotect_branchRemove protection from a branch
update_branch_protectionUpdate protection rules for a branch
create_tagCreate a new tag in the repository
delete_tagDelete a tag from the repository
protect_tagAdd protection rules to a tag pattern (Premium)
unprotect_tagRemove protection from a tag pattern (Premium)
json
{
  "action": "create_branch",
  "project_id": "my-org/api",
  "branch": "feature/new",
  "ref": "main"
}
json
{
  "action": "delete_branch",
  "project_id": "my-org/api",
  "branch": "feature/old"
}
json
{
  "action": "protect_branch",
  "project_id": "my-org/api",
  "name": "main",
  "push_access_level": 40,
  "merge_access_level": 30
}
json
{
  "action": "create_tag",
  "project_id": "my-org/api",
  "tag_name": "v2.0.0",
  "ref": "main",
  "message": "Release version 2.0.0"
}

Releases

browse_releases

json
{
  "action": "list",
  "project_id": "my-org/api",
  "per_page": 10
}
json
{
  "action": "get",
  "project_id": "my-org/api",
  "tag_name": "v2.0.0"
}

manage_release

json
{
  "action": "create",
  "project_id": "my-org/api",
  "tag_name": "v2.0.0",
  "name": "v2.0.0",
  "description": "## Changes\n- Feature A\n- Bug fix B",
  "milestones": ["v2.0"]
}
json
{
  "action": "create_link",
  "project_id": "my-org/api",
  "tag_name": "v2.0.0",
  "name": "Linux Binary",
  "url": "https://example.com/bin/v2.0.0/app",
  "link_type": "package"
}

Released under the Apache 2.0 License.