MCP ServerTools
Context Search
Natural language code search
Search your codebase with natural language. Results are ranked by relevance.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
repository | string | Yes | Repository name (e.g., "owner/repo") |
q | string | Yes | Natural language search query |
task_context | string | Yes | Context about what you're working on |
current_goal | string | Yes | Your immediate objective |
search_intention | string | Yes | Why you're searching and what you plan to do |
include_content | boolean | No | Include full symbol content (default: true) |
Context Fields
The context fields help the search algorithm understand your intent:
| Field | Purpose | Example |
|---|---|---|
task_context | What you're working on | "Implementing user authentication" |
current_goal | What you want to find | "Find login validation logic" |
search_intention | Why you're searching | "Understand how auth works to add OAuth" |
Example
Ask your agent:
"Find code related to user authentication"
Or provide context for better results:
"I'm adding OAuth support. Find the existing authentication code so I can understand how to integrate with it."
Results
Results include relevant code symbols, matching documentation, and standalone definitions. Matches include source locations and, when requested, signatures and source content.
Tips
- Be specific: "stripe webhook handler" beats "payment code"
- Provide context: Better task descriptions = better results
- Start broad, then narrow: Search "payments", then "refund processing"
- Use
include_content: falsefor faster responses when you only need locations
Related
- Cypher Query - Precise graph queries
- Document Search - Search documentation
- Impact Detection - Find affected code