grok_code_reasoning
Debug code, review architecture, and analyze quantitative or data problems with Grok reasoning; optionally execute Python calculations or search the web to verify APIs and CVEs.
Instructions
Use Grok's frontier reasoning model for debugging, architecture review, or quantitative analysis.
Args: prompt: Code snippet, bug report, math/data problem, or architecture question. model: Optional xAI model ID (defaults to XAI_REASONING_MODEL / grok-4.7). enable_code_interpreter: Allow Grok to execute Python on xAI's server-side sandbox to verify calculations. enable_web_search: Also enable live web search (e.g., to verify latest library APIs or CVEs).
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": {
"prompt": "<prompt>"
},
"name": "grok_code_reasoning"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| enable_web_search | No | ||
| enable_code_interpreter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |