Search Code
search_codeLocate where a function, variable, string, or regex pattern appears across .js, .ts, .tsx, and .jsx files under a project directory.
Instructions
Searches for a text pattern (plain substring or regex) across all .js, .ts, .tsx, and .jsx files under a directory. Use this to find where a function, variable, string, or pattern is used in the codebase.
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": {
"pattern": "<pattern>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Text or regex pattern to search for. | |
| directory | No | Directory to search, relative to project root. Defaults to ".". |