grok_task
Delegate a coding task to Grok Build as a subagent within your repository, and receive a git-verified list of file changes and commands executed.
Instructions
Delegate a coding task to Grok Build (headless) as a subagent. Runs in the given repository using the user's existing Grok OAuth login. Returns grok's response plus a git-verified list of files changed and commands run. For tasks likely to exceed ~1 minute, pass background: true and poll grok_task_result ā long synchronous calls can hit the MCP client's request timeout. Jobs in the same cwd run serially (queued) to keep results accurate. To continue a previous task with context intact, pass its session_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to the target repository/directory the task should run in. | |
| model | No | Grok model ID (default: grok-4.5). Use grok_models to list valid IDs. Pass grok-composer-2.5-fast for Composer. | |
| effort | No | Grok effort level (maps to --effort; default: high). | |
| prompt | Yes | The coding task for Grok Build to perform. | |
| background | No | If true, return immediately with a job_id; fetch the outcome with grok_task_result. Recommended for anything non-trivial. | |
| session_id | No | Session UUID from a previous grok_task result. Resumes that session so grok keeps its context (files read, decisions made) instead of starting cold. | |
| timeout_ms | No | Per-task timeout in ms (default 900000, clamped to 10sā2h). | |
| permission_mode | No | Grok permission mode. Headless-viable for coding tasks: "auto" (recommended) or "bypassPermissions". "acceptEdits" is NOT headless-viable ā it cancels the run at the first file write. Omit to use grok's default (relies on the user's global config). |