Skip to main content
Glama
cocoindex-io

cocoindex-code

Official
by cocoindex-io

search

Perform semantic code search across your entire codebase using natural language queries or code snippets. Find implementations, understand features, and locate related code by meaning instead of text matching.

Instructions

Semantic code search across the entire codebase -- finds code by meaning, not just text matching. Use this instead of grep/glob when you need to find implementations, understand how features work, or locate related code without knowing exact names or keywords. Accepts natural language queries (e.g., 'authentication logic', 'database connection handling') or code snippets. Returns matching code chunks with file paths, line numbers, and relevance scores. Start with a small limit (e.g., 5); if most results look relevant, use offset to paginate for more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (1-100)
pathsNoFilter by file path pattern(s) using GLOB wildcards (* and ?). Example: ['src/utils/*', '*.py']
queryYesNatural language query or code snippet to search for. Examples: 'error handling middleware', 'how are users authenticated', 'database connection pool', or paste a code snippet to find similar code.
offsetNoNumber of results to skip for pagination
languagesNoFilter by programming language(s). Example: ['python', 'typescript']
refresh_indexNoWhether to incrementally update the index before searching. Set to False for faster consecutive queries when the codebase hasn't changed.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetNo
messageNo
resultsNo
successYes
total_returnedNo
Behavior4/5

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

With no annotations, the description fully covers behavioral aspects: it returns matching code chunks with file paths, line numbers, and relevance scores. It also explains pagination (offset) and the refresh_index parameter's effect on performance. No destructive behavior is implied, but could mention that search is based on an index.

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 concise and well-structured: it starts with the primary purpose, then when to use, then input/return details, and ends with usage tip. Every sentence adds value, and there is no redundancy.

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

Completeness5/5

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

Given the tool has 6 parameters (1 required) and an output schema (not shown), the description covers all key aspects: semantic search capability, use cases, return format (chunks with paths, numbers, scores), filtering via paths/languages, pagination, and index refresh behavior. It is complete enough for an agent to use the tool effectively.

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. The description provides examples for query and guidance on limit/offset, but adds limited additional meaning beyond schema descriptions. The parameter details are already well-documented in the 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?

The description clearly states the tool performs semantic code search, distinguishes it from grep/glob, and explains it finds code by meaning. It uses specific verbs and resource ('semantic code search across the entire codebase') and provides examples (e.g., 'authentication logic'), making the purpose unmistakable.

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?

Explicit when-to-use guidance is provided: 'Use this instead of grep/glob' for finding implementations, understanding features, or locating related code. It also gives practical advice on pagination: start with small limit, use offset for more results.

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/cocoindex-io/cocoindex-code'

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