Skip to main content
Glama
qduc

code-rag-mcp

by qduc

search_codebase

Semantically search a codebase by meaning, not keywords, using natural language queries with AI reranking.

Instructions

Semantic code search with AI reranking. Finds relevant code by meaning, not keywords.

CRITICAL: Write Specific Queries

Vague queries return noise. Specific queries find exactly what you need.

GOOD (specific intent + context): • "retry logic with exponential backoff in HTTP client" • "JWT token validation and refresh flow" • "database connection pooling configuration" • "error handling for file upload timeout" • "how user permissions are checked before API access"

BAD (too vague - avoid these): • "authentication" → TOO BROAD. Try: "password hashing during user login" • "error handling" → TOO BROAD. Try: "error handling when payment fails" • "config" → TOO BROAD. Try: "database connection config loading" • "utils" or "helper" → MEANINGLESS. Describe what the util DOES.

Query Formula

[WHAT] + [WHERE/WHEN/HOW] = Good Query • "caching" → "Redis caching for API response memoization" • "logging" → "structured logging setup for request tracing"

Tips

• Include the PROBLEM you're solving, not just keywords • Mention specific technologies if relevant (Redis, JWT, WebSocket) • Follow up with file read for full context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codebase_pathYesAbsolute path to the codebase root directory (e.g., '/home/user/myproject')
queryYesSPECIFIC natural language query describing what you need. Include context: WHAT you're looking for + WHY/WHERE/HOW. GOOD: 'JWT token refresh when access token expires' BAD: 'token' or 'auth' (too vague, will return noise)
max_resultsNoMaximum number of results to return (default: 5 (recommended), max: 10)
expand_contextNoIf true, include surrounding code for more context (slightly slower)
file_typesNoFilter by file extensions (e.g. ['.py', '.md']). Case-insensitive.
include_pathsNoOnly include files whose paths contain these strings (e.g. ['src/code_rag/api', 'tests/']).
Behavior4/5

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

No annotations are provided, so the description carries full behavioral disclosure burden. It explains the semantic nature and AI reranking, and mentions that expand_context is slower. However, it does not detail return format, error handling, or rate limits, which are minor 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?

Well-structured with clear sections and bullet points. Front-loaded with purpose, then query tips. The content is valuable, but slightly verbose; could be trimmed slightly without losing meaning. Still earns a 4 for being mostly efficient.

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 the complexity (semantic search, 6 parameters, no output schema), the description covers the query skill thoroughly and includes tips for context expansion. Lacks details on return structure and potential errors, but overall adequate for agent decision-making.

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?

All 6 parameters have schema descriptions (100% coverage). The description adds significant value beyond the schema by providing query examples and a query formula, improving understanding of how to use the 'query' parameter effectively. Baseline 3 is exceeded.

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?

Clearly states the tool performs semantic code search using AI reranking, distinguishing it from keyword search. The verb 'search' and resource 'codebase' are specific, and the description explicitly says it finds code by meaning, not keywords.

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?

Provides explicit guidance on when to use (for meaning-based search) and how to formulate queries with extensive good/bad examples and a query formula. No sibling tools are provided, but the description effectively tells the agent how to interact with this tool.

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/qduc/code-rag'

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