MCP tools
What your agent can do in a GitDB repository over MCP, grouped by task.
When your agent connects, GitDB sends it the list of available tools and a description of each, so there's nothing to set up per tool. This page is a quick reference to the core tools and what each one does for you.
A few rules apply to every tool:
- Tools work on the repository your connection names. See Connect your AI agent.
- Each tool call counts as one call against your organization's daily allowance.
- Tools that change the repository or save memories need a token with the
repo:writescope and an organization role that can write. - Semantic search and agent memory are available on plans that include them. See gitdb.co/pricing.
Search and read code
| Tool | What it does |
|---|---|
gitdb_search_code | Finds code by meaning. Describe what you're looking for in plain language. Searches the repository's default branch. Needs semantic search on your plan. |
gitdb_grep | Searches file contents with a regular expression. |
gitdb_find_files | Finds files whose paths match a glob pattern. |
gitdb_ls_dir | Lists the contents of a directory. |
gitdb_read_lines | Reads a range of lines from a file, up to 500 lines per call. |
gitdb_find_function | Finds functions and methods by name. End the name with * for a prefix match. |
gitdb_find_callers | Finds every place a function is called. |
gitdb_read_function | Returns a function's source code, looked up by name. |
gitdb_read_struct | Returns a struct or class definition, looked up by name. |
gitdb_list_symbols | Lists the functions, classes, and methods in a file or directory. |
gitdb_architecture | Shows how the repository's modules depend on each other, for the whole repository or one path. |
gitdb_list_repos | Shows details of the repository the connection is working on. |
gitdb_search_code returns results only after the repository has been AST indexed. If the repository page doesn't show AST indexed, click AST index on that page to start indexing.
History and branches
| Tool | What it does |
|---|---|
gitdb_git_log | Shows recent commits, optionally filtered by author. |
gitdb_git_show | Shows the details of one commit. |
gitdb_git_diff | Shows the diff between two commits or refs. |
gitdb_git_status | Lists the files that changed between two refs. |
gitdb_list_refs | Lists branches and tags. |
gitdb_check_status | Shows CI and check results for a commit, or for a pull request's latest commit. |
gitdb_create_branch | Creates a branch, from the default branch or from a ref you name. |
gitdb_create_tag | Tags a commit. |
gitdb_merge_branches | Merges one branch into another. If the branches conflict, it reports the conflicting files. |
Stage and commit changes
File changes are staged first and written to a branch only when your agent commits. Staged changes stay saved on GitDB until they're committed or discarded, so they survive a dropped connection.
| Tool | What it does |
|---|---|
gitdb_create_file | Stages a new file. It won't overwrite a file that already exists. |
gitdb_delete_file | Stages a file deletion. |
gitdb_list_staged | Lists the changes staged on a branch. |
gitdb_unstage | Drops one staged change without committing it. |
gitdb_discard_all | Drops every staged change on a branch without committing. |
gitdb_scan_secrets | Checks file content for leaked secrets before you commit it. |
gitdb_commit | Commits the staged changes to a branch, the default branch unless you name another. |
Agent memory
Memories are notes your agents save and search later. A memory can be anchored to a file or function, so GitDB can tell you when the code it describes has changed. These tools need agent memory on your plan.
| Tool | What it does |
|---|---|
gitdb_memory_store | Saves a memory, optionally anchored to a file or function. |
gitdb_memory_recall | Searches saved memories and flags those whose anchored code has changed since they were saved. |
gitdb_memory_forget | Deletes a memory by its ID. |
gitdb_context_recall | Searches code and memories together. Needs both semantic search and agent memory on your plan. |