contextual_keyword_search
Search for a keyword in a directory and retrieve surrounding context lines to analyze each match's role in the code.
Instructions
Search for a keyword in the current directory (wrapper around ripgrep).
Args: keyword (str): The keyword to search for (case insensitive). working_directory (str): The directory to search in. Use full absolute path. num_context_lines (int): The number of lines of context to return (both before and after the keyword). Default is 2.
Returns: str: The file path and the lines of context around the keyword.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"keyword": "<keyword>",
"working_directory": "<working_directory>"
},
"name": "contextual_keyword_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| num_context_lines | No | ||
| working_directory | Yes |