MCP ServerTools
Context Search
Natural language code search with process context
Search your codebase with natural language. Results are grouped by process and 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) |
max_processes | number | No | Max processes to return (1-300, default: 50) |
max_symbols_per_process | number | No | Max symbols per process (1-100, default: 20) |
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."
Response Structure
Results include three symbol groups:
{
"result": {
"total_count": 15,
"processes": [
{
"id": "proc_123",
"summary": "UserAuthentication",
"priority": 0.95,
"symbol_count": 5,
"avg_centrality": 0.72
}
],
"process_symbols": [
{
"id": "sym_456",
"process_id": "proc_123",
"name": "authenticateUser",
"symbol_type": "Function",
"file_path": "src/auth/authenticate.ts",
"signature": "async function authenticateUser(credentials: Credentials): Promise<User>",
"content": "...",
"fts_score": 5.2,
"centrality_score": 0.85,
"step_index": 0,
"is_fts_match": true,
"selection_range_start_line": 45,
"selection_range_start_character": 0
}
],
"documents": [
{
"id": "doc_789",
"title": "Authentication Guide",
"file_path": "docs/auth/README.md",
"preview": "..."
}
],
"definitions": [
{
"id": "sym_def",
"name": "UserCredentials",
"symbol_type": "Interface",
"file_path": "src/types/auth.ts"
}
]
}
}| Field | Description |
|---|---|
processes | Process metadata (summary, priority) without nested symbols |
process_symbols | All symbols from process chains, flattened and deduplicated |
documents | Matching markdown documentation chunks |
definitions | Standalone DTOs, interfaces, types not in any process |
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