Skip to main content
Glama
Jhackman2019

codebase-context-mcp

by Jhackman2019

search_code

Find relevant code across an indexed codebase using BM25 full-text search, returning ranked results with matching lines.

Instructions

BM25 full-text search across all files in an indexed codebase. Returns ranked results with matching lines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (keywords or code patterns)
directoryYesAbsolute path to the indexed project
maxResultsNoMaximum results to return
Behavior4/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 discloses the BM25 ranking algorithm, indicates the search is across all files, and specifies the output ('ranked results with matching lines'). This adds meaningful behavioral context beyond the tool name, though it omits error cases or performance implications.

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 two sentences with no filler. The first sentence front-loads the core purpose, and the second covers the output format. Every word contributes useful information, making it appropriately 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?

The tool has no output schema, so the description's mention of 'ranked results with matching lines' is valuable. The schema covers parameters, and the description covers core behavior and the indexing prerequisite. However, it does not address what happens if the directory is not indexed or how maxResults behaves, leaving minor gaps. Still sufficient for a search 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 description coverage is 100% for all three parameters (query, directory, maxResults). The description does not add parameter-specific details beyond what the schema already explains; the mention of 'all files' and 'indexed codebase' broadly maps to directory, but this is not a substantial addition. Therefore, baseline score of 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?

The description states 'BM25 full-text search across all files in an indexed codebase,' which is a specific verb (search) + resource (all files) + scope (indexed codebase). This clearly distinguishes it from sibling tools like search_symbols (which searches symbols) and index_codebase (which indexes).

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 phrase 'in an indexed codebase' implies a prerequisite that index_codebase should be run first, and 'full-text search' signals this is for content-based lookup rather than symbol search. However, it does not explicitly name alternatives or state when not to use the tool, so it stops short of a 5.

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

Install Server

Other Tools

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

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