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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100) | |
| paths | No | Filter by file path pattern(s) using GLOB wildcards (* and ?). Example: ['src/utils/*', '*.py'] | |
| query | Yes | Natural 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. | |
| offset | No | Number of results to skip for pagination | |
| languages | No | Filter by programming language(s). Example: ['python', 'typescript'] | |
| refresh_index | No | Whether to incrementally update the index before searching. Set to False for faster consecutive queries when the codebase hasn't changed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | ||
| message | No | ||
| results | No | ||
| success | Yes | ||
| total_returned | No |