Skip to main content
Glama

codebase-context

Map your team's conventions before your AI agent starts searching.

npm version license node

You're tired of AI agents writing code that "just works" but still misses how your team actually builds things. They search too broadly, pick generic examples, and spend tokens exploring before they understand the shape of the repo.

codebase-context changes the first step. Start with a bounded conventions map that shows the architecture, dominant patterns, and strongest local examples. Then search for the exact file, symbol, or workflow you need.

Here's what codebase-context does:

Starts with a bounded conventions map - The first call shows architecture layers, active patterns, golden files, and next calls without dumping vendored repos, fixtures, generated output, or oversized entrypoint lists into the default surface.

Finds the right local example - Search does not just return code. Each result comes back with pattern signals, file relationships, and quality indicators so the agent can move from the map to the most relevant local example instead of wandering through raw hits.

Knows what is current - Conventions are detected from your code and git history, not only from rules you wrote. The map distinguishes what is common from what is rising or declining, and points at the files that best represent the current direction.

Adds support signals when you need them - Team memory and edit-readiness checks stay available, but as supporting context after the map and search have already narrowed the work.

Map first, search second, local-first throughout. Your code never leaves your machine by default.

See the current discovery benchmark for the checked-in discovery-only proof. The gate is still pending_evidence, and claimAllowed remains false.

What it looks like

Real CLI output against angular-spotify, the repo used for the launch screenshots.

Lead signal: pattern drift and golden files

codebase-context patterns screenshot

This is the part most tools miss: what the team is doing now, what it is moving away from, and which files are the strongest examples to follow.

Before editing: preflight and impact

codebase-context search preflight screenshot

When the agent searches with edit intent, it gets a compact decision card: confidence, whether it's safe to proceed, which patterns apply, the best example, and which files are likely to be affected.

More CLI examples in docs/cli.md. Full walkthrough: demo.md on GitHub.

Related MCP server: Carto MCP Server

Quick Start

claude mcp add codebase-context -- npx -y codebase-context

The server runs in two modes. Use stdio unless you need multiple clients connected at once:

Mode

How it runs

When to use

stdio (default)

Process spawned by the client

One AI client talking to one or more repos

HTTP

Long-lived server at http://127.0.0.1:3100/mcp

Multiple clients sharing one server

Client support at a glance:

Client

stdio

HTTP

Claude Code

Yes

No (stdio only)

Claude Desktop

Yes

No

Cursor

Yes

Yes — .cursor/mcp.json with type: "http"

Windsurf

Yes

Not yet

Codex

Yes

Yes — --mcp-config flag

VS Code (Copilot)

Yes

No

OpenCode

Yes

Not documented yet

Copy-pasteable templates: templates/mcp/stdio/.mcp.json and templates/mcp/http/.mcp.json.

Full per-client setup, HTTP server instructions, and local build testing: docs/client-setup.md.

First Use

Get a conventions map of your codebase before exploring or editing:

# See your codebase conventions — architecture layers, patterns, golden files
npx -y codebase-context map

# Then search for what you need
npx -y codebase-context search --query "auth middleware"

Your AI agent uses the same map via the codebase://context MCP resource on first call.

Common First Commands

Three commands to understand a repo before you edit it:

# What are the main conventions and best examples?
npx -y codebase-context map

# Then search for the local example you need
npx -y codebase-context search --query "auth middleware"

# What patterns is the team actually using right now?
npx -y codebase-context patterns

This is also what your AI agent consumes automatically via MCP tools; the CLI is the human-readable version of the same map-plus-search flow.

What it does

The Search Tool (search_codebase)

One call returns ranked results with file, summary, score, compact type (componentType:layer), pattern trend signals, relationship hints, related team memories, a search quality assessment, and a preflight decision card when intent="edit". The decision card shows ready (boolean), nextAction when not ready, patterns (do/avoid), bestExample, impact coverage ("3/5 callers in results"), and whatWouldHelp.

Default output is lean — if the agent wants code, it calls read_file. Add includeSnippets: true for inline code with scope headers (e.g. // AuthService.getToken()).

See docs/capabilities.md for the full field reference.

Patterns & Conventions (get_team_patterns)

Detects what your team actually does by analyzing the codebase: adoption percentages for DI, state management, testing, and library patterns; trend direction (Rising / Stable / Declining) from git recency; golden files ranked by modern pattern density; conflicts when two approaches both exceed 20%.

Team Memory (remember + get_memory)

Record a decision once. It surfaces automatically in search results and preflight cards from then on. Conventional commits (refactor:, migrate:, fix:, revert:) from the last 90 days auto-extract into memory during indexing — no setup required.

Memory types: convention, decision, gotcha, failure. Confidence decay: conventions never decay, decisions 180-day half-life, gotchas/failures 90-day. Stale memories get flagged instead of blindly trusted.

Tools

Tool

What it does

search_codebase

Hybrid search + decision card when intent="edit"

get_team_patterns

Pattern frequencies, golden files, conflict detection

get_symbol_references

Concrete references to a symbol (count + snippets)

remember

Record a convention, decision, gotcha, or failure

get_memory

Query team memory with confidence decay scoring

get_codebase_metadata

Project structure, frameworks, dependencies

get_style_guide

Style guide rules for the current project

detect_circular_dependencies

Import cycles between files

refresh_index

Full or incremental re-index + git memory extraction

get_indexing_status

Progress and stats for the current index

Multi-project

One server, multiple repos. Three cases:

Case

What happens

One project

Routing is automatic

Multiple projects, active project already set

Routes to the active project

Multiple projects, ambiguous

Returns selection_required — retry with project

project accepts a project root path, file path, file:// URI, or relative subproject path (e.g. apps/dashboard).

{
  "name": "search_codebase",
  "arguments": {
    "query": "auth interceptor",
    "project": "apps/dashboard"
  }
}

If you get selection_required, retry with one of the paths from availableProjects. Full routing details and response shapes in docs/capabilities.md.

Language Support

10 languages with full symbol extraction via Tree-sitter: TypeScript, JavaScript, Python, Java, Kotlin, C, C++, C#, Go, Rust. 30+ languages with indexing and retrieval coverage, including PHP, Ruby, Swift, Scala, Shell, and config formats. Angular, React, and Next.js have dedicated analyzers; everything else uses the Generic analyzer with AST-aligned chunking when a grammar is available.

Configuration

Variable

Default

Description

EMBEDDING_PROVIDER

transformers

openai (fast, cloud) or transformers (local, private)

OPENAI_API_KEY

Required only if using openai provider

CODEBASE_ROOT

Bootstrap root for CLI and single-project MCP clients

CODEBASE_CONTEXT_DEBUG

Set to 1 for verbose logging

EMBEDDING_MODEL

Xenova/bge-small-en-v1.5

Local embedding model override

CODEBASE_CONTEXT_HTTP

Set to 1 to start in HTTP mode (same as --http flag)

CODEBASE_CONTEXT_PORT

3100

HTTP server port override (same as --port; ignored in stdio mode)

CODEBASE_CONTEXT_CONFIG_PATH

~/.codebase-context/config.json

Override the server config file path

Performance

  • First indexing: 2-5 minutes for ~30k files (embedding computation).

  • Subsequent queries: milliseconds from cache.

  • Incremental updates: refresh_index with incrementalOnly: true processes only changed files (SHA-256 manifest diffing).

File Structure

.codebase-context/
  memory.json         # Team knowledge (should be persisted in git)
  index-meta.json     # Index metadata and version (generated)
  intelligence.json   # Pattern analysis (generated)
  relationships.json  # File/symbol relationships (generated)
  index.json          # Keyword index (generated)
  index/              # Vector database (generated)

Recommended .gitignore:

# Codebase Context - ignore generated files, keep memory
.codebase-context/*
!.codebase-context/memory.json

What to add to your CLAUDE.md / AGENTS.md

Paste this into .cursorrules, CLAUDE.md, AGENTS.md, or wherever your AI reads project instructions:

## Codebase Context (MCP)

**Start of every task:** Call `get_memory` to load team conventions before writing any code.

**Before editing existing code:** Call `search_codebase` with `intent: "edit"`. If the preflight card says `ready: false`, read the listed files before touching anything.

**Before writing new code:** Call `get_team_patterns` to check how the team handles DI, state, testing, and library wrappers — don't introduce a new pattern if one already exists.

**When asked to "remember" or "record" something:** Call `remember` immediately, before doing anything else.

**When adding imports that cross module boundaries:** Call `detect_circular_dependencies` with the relevant scope after adding the import.

These are the behaviors that make the most difference day-to-day. Copy, trim what doesn't apply to your stack, and add it once.

License

Elastic-2.0

Available Tools

11 tools
detect_circular_dependenciesA

Routes to the active/current project automatically when known. Analyze the import graph to detect circular dependencies between files. Circular dependencies can cause initialization issues, tight coupling, and maintenance problems. Returns all detected cycles sorted by length (shorter cycles are often more problematic).

ParametersJSON Schema
NameRequiredDescriptionDefault
scopeNoOptional path prefix to limit analysis (e.g., 'src/features', 'libs/shared')
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It reveals that results are sorted by length and notes that shorter cycles are often more problematic. However, it does not explicitly state whether the operation is read-only or has side effects, nor does it mention performance implications for large codebases.

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

Conciseness4/5

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

The description is three sentences, efficient but with a minor redundancy: the first sentence about routing ('Routes to the active/current project automatically') is not central to the tool's purpose. Overall, it is well-structured and front-loads the core action.

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?

The description explains return value sorting and interpretation but lacks details on output format, data structure of cycles, or potential limitations (e.g., large graphs). Given no output schema, this is adequate but leaves ambiguity for complex filtering needs.

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

Parameters3/5

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

The input schema covers all three parameters with descriptions, achieving 100% schema description coverage. The tool description does not add meaningful detail beyond what the schema already provides (e.g., 'scope' is described as an optional path prefix in both). Baseline score of 3 applies.

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 clearly states the tool's function: 'Analyze the import graph to detect circular dependencies between files.' It identifies a specific verb (analyze/detect) and a distinct resource (circular dependencies in imports), differentiating it from sibling tools like get_codebase_health.

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?

The description explains why circular dependencies are problematic ('can cause initialization issues, tight coupling'), implying the tool's value. However, no explicit guidance on when to use this tool versus alternatives (e.g., get_codebase_health), nor any exclusions or prerequisites.

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

get_codebase_healthA

Routes to the active/current project automatically when known. Get actionable codebase health signals from the latest index. Returns the highest-risk files and their reasons, or a single file when requested.

ParametersJSON Schema
NameRequiredDescriptionDefault
fileNoOptional file path to inspect a single file-level health record.
limitNoMaximum number of files to return when no file is specified (default: 10).
levelNoOptional minimum health level to return.
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.5/5.0
Behavior2/5

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

No annotations provided, so description carries full burden. Mentions auto-routing to active project and returns risk info, but does not explicitly state read-only nature or any side effects. Incomplete for a tool with no annotations.

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

Conciseness5/5

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

Three sentences with no fluff. First sentence sets behavioral expectation, second states purpose, third gives filtering options. Efficient and well-structured.

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?

Adequate for a read tool with good schema coverage, but lacks detail on return format (e.g., what constitutes 'health signals' or 'highest-risk'). Output schema is absent, so more description would help.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. Description adds context for 'file' parameter (why to use it) but largely mirrors schema. Does not compensate for any missing schema details.

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 clearly states the tool retrieves actionable codebase health signals, returns highest-risk files with reasons, or single file when requested. It distinguishes from siblings like get_codebase_metadata and detect_circular_dependencies.

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?

Implies routing to active project automatically, so user may not need to specify project, but no explicit when-to-use or when-not-to-use compared to alternatives. Lacks exclusions for specific scenarios.

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

get_codebase_metadataB

Routes to the active/current project automatically when known. Get codebase metadata including framework information, dependencies, architecture patterns, and project statistics.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the burden of behavioral disclosure. It reveals one behavioral trait (automatic routing), but does not address potential error states, authentication requirements, or the read-only nature of the operation. This provides moderate transparency but leaves gaps.

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

Conciseness5/5

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

The description is extremely concise with two sentences, front-loading the key behavioral hint. Every word adds value without redundancy or fluff.

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 the lack of output schema and the moderate complexity of the tool (multiple metadata types), the description provides a reasonable overview but does not fully specify the return structure, error conditions, or behavior when no project is known. It is adequate but not comprehensive.

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

Parameters3/5

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

The input schema has 100% description coverage for both parameters (project and project_directory). The description adds no additional meaning beyond what the schema already provides. Per the guidelines, with high schema coverage, a baseline of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool retrieves codebase metadata including specific items like framework, dependencies, architecture patterns, and statistics. This sufficiently distinguishes it from sibling tools that have different focuses (e.g., health, style guide), though it could be more explicit about what it does not cover.

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

Usage Guidelines2/5

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

The description mentions automatic routing to the active project when known, providing some context. However, there is no explicit guidance on when to use this tool versus alternatives like get_codebase_health or get_team_patterns, nor any mention of prerequisites or when not to use it.

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

get_indexing_statusA

Routes to the active/current project automatically when known. Get current indexing status: state, statistics, and progress. Use refresh_index to manually trigger re-indexing when needed.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It mentions automatic routing behavior, which is useful. No destructive actions implied, but lacks details on permissions or rate limits. For a read-only status tool, it's transparent enough.

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

Conciseness5/5

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

Two sentences, no fluff. First sentence gives routing behavior, second gives tool purpose and sibling reference. Exceptionally concise.

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

Completeness4/5

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

Covers purpose, routing, and sibling reference. No output schema, but description mentions return includes state, statistics, and progress. Missing detailed output structure, but adequate for a status check tool.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for both parameters. Description adds that project accepts various formats and project_directory is deprecated, slightly complementing schema. Baseline 3 is appropriate.

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?

Description clearly states 'Get current indexing status: state, statistics, and progress.' Verb and resource are specific, and it distinguishes from sibling refresh_index.

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

Usage Guidelines5/5

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

Explicitly says 'Routes to the active/current project automatically' and 'Use refresh_index to manually trigger re-indexing when needed,' providing clear when-to-use and alternatives.

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

get_memoryA

Routes to the active/current project automatically when known. Retrieves team conventions, architectural decisions, and known gotchas. CALL BEFORE suggesting patterns, libraries, or architecture.

Filters: category (tooling/architecture/testing/dependencies/conventions), type (convention/decision/gotcha), query (keyword search).

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category
typeNoFilter by memory type
queryNoKeyword search across memory and reason
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, and the description only mentions automatic routing to the active project. It fails to disclose behavioral traits such as read-only nature, side effects, error handling, or limitations, which is a significant gap for a retrieval tool.

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

Conciseness5/5

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

The description is extremely concise: two sentences plus a line listing filters. Every sentence provides essential information without extraneous words, making it easy to scan.

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?

With no output schema and no annotations, the description covers purpose and usage well but lacks details on return values, result count, pagination, or error conditions. It is adequate but not fully complete for a tool that influences important decisions.

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

Parameters3/5

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

The description adds value by listing filter enums and query usage, but it omits two parameters (project and project_directory) entirely. Since schema description coverage is 100%, the baseline is 3, but missing param details reduce the added value.

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 clearly states the tool retrieves team conventions, architectural decisions, and known gotchas, with automatic routing to the active project. It distinguishes itself from siblings like get_style_guide or get_team_patterns by being a general memory retrieval tool.

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

Usage Guidelines4/5

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

The description explicitly advises 'CALL BEFORE suggesting patterns, libraries, or architecture,' providing clear context for when to use. It lacks explicit when-not-to-use or alternative tool mentions, but the usage instruction is strong.

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

get_style_guideA

Routes to the active/current project automatically when known. Query style guide rules and architectural patterns from project documentation.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoQuery for specific style guide rules (e.g., "component naming", "service patterns")
categoryNoFilter by category (naming, structure, patterns, testing)
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description reveals the automatic project routing behavior and the query nature, suggesting a read-only operation. However, it does not explicitly state that it is non-destructive, what happens if no project is active, or any error conditions, leaving some behavioral ambiguity.

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

Conciseness5/5

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

The description is only two sentences, front-loading the key automatic routing feature and then the main query purpose. Every sentence is necessary and without fluff, achieving maximum conciseness.

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

Completeness2/5

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

No output schema exists, so the description should explain what the tool returns. It does not describe the return format, error handling, or behavior when no results are found. The deprecated 'project_directory' parameter is not addressed. This leaves significant gaps for an agent to use the tool correctly.

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?

Parameter descriptions in schema cover 100% of parameters, already defining each parameter's purpose. The description adds value by explaining the automatic routing behavior for the optional 'project' parameter, clarifying that omitting it uses the active project, which goes beyond the schema's description.

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 clearly states the tool queries style guide rules and architectural patterns from project documentation, using the verb 'Query' and resource 'style guide rules and architectural patterns'. It distinguishes itself from siblings like search_codebase (which is broader) and get_team_patterns (which is team-specific) by focusing specifically on style guide documentation.

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?

The description implies usage for querying style guide rules in the current project due to automatic routing, but does not explicitly state when to use it over alternatives (e.g., search_codebase for general search, get_team_patterns for team patterns). No when-not or explicit alternative guidance is provided.

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

get_symbol_referencesA

Routes to the active/current project automatically when known. Find concrete references to a symbol in indexed chunks. Returns total usageCount and top usage snippets.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesSymbol name to find references for (for example: parseConfig or UserService)
limitNoMaximum number of usage snippets to return (default: 10)
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description bears full responsibility. It mentions automatic routing to active project and return values, but lacks details on error cases, latency, or index prerequisites. Adequate but not thorough.

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

Conciseness5/5

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

Two concise sentences that front-load key information: routing and core function. No fluff, every sentence adds value.

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

Completeness4/5

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

Despite lacking an output schema, the description mentions return values (usageCount and snippets). It covers the core function and project routing, but could elaborate on snippet ranking and error conditions.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds little beyond what the schema already provides for parameters. The routing behavior hinted at is not tied explicitly to parameters.

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 clearly states the tool's purpose: finding concrete references to a symbol in indexed chunks. It uses specific verbs and resources, and the name itself is descriptive. Though it doesn't explicitly differentiate from siblings, the function is distinct.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like search_codebase or detect_circular_dependencies. The description does not mention prerequisites or when not to use it.

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

get_team_patternsA

Routes to the active/current project automatically when known. Get actionable team pattern recommendations based on codebase analysis. Returns consensus patterns for DI, state management, testing, library wrappers, etc.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNoPattern category to retrieve
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A4.2/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. Mentions automatic project routing (a behavioral trait) and returns consensus patterns. No side effects or mutability mentioned, but seems read-only.

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

Conciseness5/5

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

Two concise sentences, front-loaded with key purpose and automatic behavior. No unnecessary words.

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

Completeness4/5

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

For a tool with 3 params and no output schema, description is fairly complete: explains what it does, mentions project auto-routing, and lists pattern types. Could clarify return structure or 'consensus patterns' further.

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% with clear param descriptions. Description adds context by listing example pattern categories (DI, state, testing) which correspond to the enum values, providing meaning beyond schema.

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?

Description clearly states the tool retrieves team pattern recommendations for specific categories (DI, state management, etc.) and mentions automatic project routing. Distinguished from siblings like get_codebase_health and get_style_guide.

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?

No explicit when-to-use or when-not-to-use guidance. Context signals and sibling names imply usage for pattern analysis, but no direct alternatives mentioned.

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

refresh_indexA

Routes to the active/current project automatically when known. Re-index the codebase. Supports full re-index or incremental mode. Use incrementalOnly=true to only process files changed since last index.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonNoReason for refreshing the index (for logging)
incrementalOnlyNoIf true, only re-index files changed since last full index (faster). Default: false (full re-index)
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A3.7/5.0
Behavior3/5

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

The description mentions automatic routeing to the active project and re-indexing behavior, but does not disclose side effects, permissions, or what happens to the existing index. With no annotations, more detail would be beneficial.

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

Conciseness4/5

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

Three sentences conveying essential info, though the first sentence is slightly ambiguous ('Routes to...'). Still, it is concise and front-loaded.

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

Completeness2/5

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

No output schema is provided, and the description does not explain what the tool returns or how to interpret results, leaving the agent without critical information for a re-index operation.

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

Parameters3/5

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

All parameters have schema descriptions (100% coverage). The description adds minor guidance on incrementalOnly usage, but mostly restates schema info, so it provides limited added value.

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 clearly states it re-indexes the codebase and supports full or incremental modes, distinguishing it from siblings like search_codebase or get_indexing_status.

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

Usage Guidelines4/5

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

It advises using incrementalOnly=true for faster re-indexing of changed files, but does not explicitly state when not to use the tool or mention alternative tools for specific scenarios.

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

rememberA

Routes to the active/current project automatically when known. CALL IMMEDIATELY when user explicitly asks to remember/record something.

USER TRIGGERS:

  • "Remember this: [X]"

  • "Record this: [Y]"

  • "Save this for next time: [Z]"

DO NOT call unless user explicitly requests it.

HOW TO WRITE:

  • ONE convention per memory (if user lists 5 things, call this 5 times)

  • memory: 5-10 words (the specific rule)

  • reason: 1 sentence (why it matters)

  • Skip: one-time features, code examples, essays

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYesType of memory being recorded. Use "failure" for things that were tried and failed - prevents repeating the same mistakes.
categoryYesBroader category for filtering
memoryYesWhat to remember (concise)
reasonYesWhy this matters or what breaks otherwise
scopeNoOptional scope for this memory. Use { kind: "file", file } or { kind: "symbol", file, symbol }.
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description must cover behavioral traits. It mentions 'Routes to the active/current project automatically' but does not disclose side effects (e.g., whether memories overwrite, persistence, permissions, or rate limits). The instructions on writing style give some behavioral expectations but leave significant gaps.

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

Conciseness4/5

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

The description is structured with headings (USER TRIGGERS, DO NOT, HOW TO WRITE) and front-loads the key action. While it is somewhat lengthy, every section serves a purpose. Minor redundancy in listing all triggers could be trimmed, but overall it is well-organized.

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?

With 7 parameters (4 required) and no output schema, the description provides good guidance on when and how to call, but omits post-call behavior (e.g., success confirmation, error handling). The agent must infer that memories are stored since get_memory exists. Context is adequate but not fully complete.

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 baseline is 3. The description adds value by providing guidance on how to write 'memory' (5-10 words) and 'reason' (1 sentence), and explains when to use 'failure' type. This enriches the schema descriptions and helps the agent use parameters effectively.

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 clearly states the tool's purpose: to remember/record something when the user explicitly asks. It lists specific user triggers ('Remember this', 'Record this', 'Save this for next time') and provides instructions for when to call it. This differentiates it from siblings like get_memory, which retrieves memories.

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

Usage Guidelines5/5

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

The description provides explicit guidelines: 'CALL IMMEDIATELY when user explicitly asks to remember/record something' and 'DO NOT call unless user explicitly requests it.' It also gives writing conventions ('ONE convention per memory', 'memory: 5-10 words', 'Skip: one-time features, code examples, essays'), making the usage clear.

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

search_codebaseA

Routes to the active/current project automatically when known. Search the indexed codebase. Default compact mode returns at most 6 ranked results with light graph context (importedByCount, topExports, layer), a patternSummary, bestExample, nextHops, and response-budget metadata. Use mode="full" for today's richer response with full hints arrays and all memories — identical shape as before this parameter existed. IMPORTANT: Pass the intent="edit"|"refactor"|"migrate" to get preflight: edit readiness check with evidence gating.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query
modeNoResponse mode. compact (default): max 6 results with light graph context, pattern summary, best example, next hops, and budget metadata. full: today's richer shape + budget metadata.compact
intentNoOptional. Use "edit", "refactor", or "migrate" to get the full preflight card before making changes.
limitNoMaximum number of results to return (default: 5)
includeSnippetsNoInclude code snippets in results (default: false). If you need code, prefer read_file instead.
filtersNoOptional filters
projectNoOptional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.
project_directoryNoDeprecated compatibility alias for older clients. Prefer project.

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description fully carries behavioral transparency. It describes default behavior (compact mode, 6 results, graph context), full mode, intent parameter effects, and hints about response metadata. It also warns about includeSnippets default and recommends read_file for code.

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

Conciseness4/5

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

The description is well-structured, front-loading key information about routing and search function. It provides detailed mode and intent guidance but could be more concise by merging some sentences. Overall, it balances detail and readability.

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

Completeness4/5

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

Given no output schema, the description explains the compact mode return shape (graph context, pattern summary, etc.) and mentions budget metadata. It covers filters and parameters. However, it omits error handling, pagination beyond limit, and behavior for empty queries. Still fairly complete for a search tool.

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%, baseline is 3. The description adds value by explaining the compact mode result count (at most 6 vs schema default limit of 5), clarifying the intent parameter's role for preflight, and noting the routing behavior for project. This exceeds basic schema info.

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 clearly states it searches the indexed codebase, auto-routes to active project, and details the return format. It distinguishes from siblings like get_codebase_health or detect_circular_dependencies by being a search tool.

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

Usage Guidelines4/5

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

The description guides when to use compact vs full mode and when to pass intent for preflight. It notes that includeSnippets is false by default and to prefer read_file. However, it does not contrast with sibling tools or mention when not to use the tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 12 tool updatesv1.6.0
    • Changeddetect_circular_dependencies2 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
    • Addedget_codebase_health
    • Changedget_codebase_metadata2 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
    • Removedget_component_usage
    • Changedget_indexing_status2 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
    • Changedget_memory3 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
      • changedInput schema / properties / type / enum
        Previous value: -[
        -  "convention",
        -  "decision",
        -  "gotcha"
        -]New value: +[
        +  "convention",
        +  "decision",
        +  "gotcha",
        +  "failure"
        +]
    • Changedget_style_guide3 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
      • removedInput schema / required
        Removed value: -[
        -  "query"
        -]
    • Addedget_symbol_references
    • Changedget_team_patterns2 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
    • Changedrefresh_index2 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
    • Changedremember5 fields changed
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
      • addedInput schema / properties / scope
        Added value: +{
        +  "description": "Optional scope for this memory. Use { kind: \"file\", file } or { kind: \"symbol\", file, symbol }.",
        +  "properties": {
        +    "file": {
        +      "type": "string"
        +    },
        +    "kind": {
        +      "enum": [
        +        "global",
        +        "file",
        +        "symbol"
        +      ],
        +      "type": "string"
        +    },
        +    "symbol": {
        +      "type": "string"
        +    }
        +  },
        +  "type": "object"
        +}
      • changedInput schema / properties / type / description
        Previous value: -"Type of memory being recorded"New value: +"Type of memory being recorded. Use \"failure\" for things that were tried and failed - prevents repeating the same mistakes."
      • changedInput schema / properties / type / enum
        Previous value: -[
        -  "convention",
        -  "decision",
        -  "gotcha"
        -]New value: +[
        +  "convention",
        +  "decision",
        +  "gotcha",
        +  "failure"
        +]
    • Changedsearch_codebase6 fields changed
      • changedInput schema / properties / filters / properties / framework / description
        Previous value: -"Filter by framework (angular, react, vue)"New value: +"Filter by framework (angular, react, nextjs, vue)"
      • addedInput schema / properties / includeSnippets
        Added value: +{
        +  "default": false,
        +  "description": "Include code snippets in results (default: false). If you need code, prefer read_file instead.",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / intent
        Added value: +{
        +  "description": "Optional. Use \"edit\", \"refactor\", or \"migrate\" to get the full preflight card before making changes.",
        +  "enum": [
        +    "explore",
        +    "edit",
        +    "refactor",
        +    "migrate"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / mode
        Added value: +{
        +  "default": "compact",
        +  "description": "Response mode. compact (default): max 6 results with light graph context, pattern summary, best example, next hops, and budget metadata. full: today's richer shape + budget metadata.",
        +  "enum": [
        +    "compact",
        +    "full"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / project
        Added value: +{
        +  "description": "Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root.",
        +  "type": "string"
        +}
      • addedInput schema / properties / project_directory
        Added value: +{
        +  "description": "Deprecated compatibility alias for older clients. Prefer project.",
        +  "type": "string"
        +}
  2. 10 tool updatesv1.4.1
    • First observeddetect_circular_dependencies
    • First observedget_codebase_metadata
    • First observedget_component_usage
    • First observedget_indexing_status
    • First observedget_memory
    • First observedget_style_guide
    • First observedget_team_patterns
    • First observedrefresh_index
    • First observedremember
    • First observedsearch_codebase

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct aspect of codebase context: detection, health, metadata, indexing, memory, style guide, references, patterns, refresh, remember, and search. No two tools have overlapping purposes; descriptions clearly differentiate them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., get_codebase_health, detect_circular_dependencies). The only exception is 'remember' which is a single verb but remains clear and fits the pattern.

Tool Count5/5

11 tools is well-scoped for a codebase context server. It covers indexing, querying, analysis, and memory without being overwhelming. Each tool earns its place.

Completeness4/5

The tool set covers reading and writing codebase knowledge, analysis (dependencies, health, references), and search. Minor gaps exist, such as no direct file content retrieval or code review integration, but the domain of 'context' is well-served.

Maintenance

ActivityMaintained
ResponsivenessWithin a week

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Provides AI assistants with persistent memory of your project architecture, development history, and technical decisions, allowing them to give context-aware coding help without needing repeated explanations.
    16
    61
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides AI coding assistants with deep, semantic understanding of local codebases via AST-aware chunking, cross-repo symbol graphs, and architectural memory, enabling context-aware code search and dependency tracing.
    10
    MIT

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/PatrickSys/codebase-context'

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