Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GITHUB_TOKENNoOptional. Raises GitHub's API rate limit for PR lookups
PROJECT_BRAIN_HOMENoDirectory for indexes and clones~/.project-brain
PROJECT_BRAIN_EMBEDDERNoEmbedder to use. `hash` gives an offline, deterministic embedder (used in tests)fastembed
PROJECT_BRAIN_FETCH_PRSNoSet to `0` to never call the GitHub API1
PROJECT_BRAIN_EMBED_MODELNoAny fastembed text modelBAAI/bge-small-en-v1.5
PROJECT_BRAIN_MAX_FILE_BYTESNoLarger files are skipped512000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Codebase Brain indexes code repositories and answers questions about them with citations. Start with index_repo (a local path or an https git URL). Then use ask_codebase for questions, search for raw hybrid search, and read_lines to open the exact lines a citation points at. For "why is it like this?" questions, use explain_history on a symbol or line range, and search_history to find commits by topic. Before changing a function, run impact_of_change to see what depends on it. find_doc_drift lists documentation that no longer matches the code. Cite code as path:start-end and commits by short sha.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
index_repoA

Index a repository so the other tools can search it. Use this first, and again after the code changes: re-running only re-embeds files whose content changed. A URL is cloned with full history (blobless), so explain_history works. Reports progress while it runs, and returns file counts and the commit indexed.

searchA

Hybrid search over code and docs (BM25 keywords plus local embeddings, fused by rank). Use this for a targeted lookup, or when you need filters by folder or chunk kind; for a question you'll answer in prose, use ask_codebase instead. Returns ranked chunks, each with a path:start-end citation, its symbol and a snippet.

ask_codebaseA

Gather the code and docs most relevant to a question, plus related commits, as numbered, cited sources. Use this to answer "how does X work?" or "where is Y handled?" questions. Answer from these sources only and cite each claim as path:start-end; open a source in full with read_lines. For filters, use search.

explain_historyA

Why code looks the way it does. Use this before removing or rewriting code that looks odd, or to answer "why is it like this?". Give a symbol, or a path with an optional line range. Returns who wrote the current lines, every commit that changed them (with the relevant diff), and the title and description of the pull request behind each commit (GitHub only).

impact_of_changeA

What breaks if a symbol changes: code that uses it directly, code that uses that code, and the tests involved. Use this before editing a shared function, and run or update the tests it lists. Python, JavaScript and TypeScript are analysed structurally. Matches are by name, so check the same-name notes it returns.

find_doc_driftA

Documentation that no longer matches the code. Use this to check a README or docs folder, or before a release. Finds files, functions, settings and flags that don't exist; code examples that pass parameters a function doesn't take; imports that would fail; and stale sections. Each finding has a severity, cites the doc section and suggests a fix. Changelogs are skipped.

search_historyA

Find commits by what their messages say. Use this to answer "when did we change X?" or "which commit fixed Y?". For the history of one function or file, use explain_history instead.

read_linesA

Exact, numbered lines from a file in an indexed repo. Use this to open a citation in full before quoting or editing it, since search results are trimmed snippets. Refuses paths outside the repo.

list_reposA

Repositories indexed so far, with their size, languages and the commit they were indexed at. Use this first to see what's available and to get the repo names the other tools take.

Prompts

Interactive templates invoked by user choice

NameDescription
answer_with_citationsAnswer a question about a codebase with strict citations.

Resources

Contextual data attached and managed by the client

NameDescription
indexed-reposEvery indexed repository and its stats.

TDQS

A4.1/5.0

Scored across 9 tools

Disambiguation5/5

Each tool has a clearly distinct role: indexing, targeted search, prose Q&A, history explanation, impact analysis, doc drift, commit-message search, line reading, and repo listing. The descriptions explicitly route agents between overlapping-sounding tools, such as search vs. ask_codebase and explain_history vs. search_history.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern: index_repo, ask_codebase, explain_history, find_doc_drift, search_history, read_lines, list_repos. Minor deviations are the bare search and noun-phrase impact_of_change, but the set remains predictable and readable.

Tool Count5/5

Nine tools is well-scoped for a codebase indexing and intelligence server. Each tool covers a meaningful operation without obvious redundancy or bloat.

Completeness4/5

The surface covers indexing, discovery, search, Q&A, history, impact analysis, doc drift, and exact file reading, which supports the core workflows. Minor lifecycle gaps remain, such as no explicit repo removal or unindex operation, but agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues