feat(cli): expose region option on the MCP trigger_task tool (#4439)

<!-- ccr-slack-attribution -->
_Requested by **Eric Allam** · [Slack
thread](https://triggerdotdev.slack.com/archives/C0BEM9Z73TM/p1785491472104199)_

## Checklist

- [ ] I have followed every step in the [contributing
guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md)
- [x] The PR title follows the convention.
- [ ] I ran and tested the code works

---

## Testing

Static checks only, all clean:

- `pnpm run typecheck --filter trigger.dev`
- `pnpm run format`
- `pnpm run lint`

No live task was triggered against a running project, so the "ran and
tested" box above is left unchecked.

---

## Changelog

**Before:** triggering a task through the MCP server always ran it in
the project's default region. There was no way to pick one.

**After:** the `trigger_task` tool accepts an optional `region` option,
so you can choose the region a run executes in.

**How:** `region: z.string().optional()` was added to
`TriggerTaskInput.options` in `packages/cli-v3/src/mcp/schemas.ts`. No
call-site change was needed — `tools/tasks.ts` passes `options` through
verbatim, and `TriggerTaskRequestBody.options.region` already existed.
The tool description in `docs/mcp-tools.mdx` gained a matching line, and
a patch changeset is included.

There is no batch-trigger MCP tool, so there is no sibling tool to
mirror this change on.

---

## Screenshots

N/A — no UI changes.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
claude[bot]
2026-07-31 11:54:42 +01:00
committed by GitHub
parent efcb89ac26
commit 17d849b2d6
3 changed files with 12 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---
You can now choose the region a run executes in when triggering a task through the MCP server.
+1 -1
View File
@@ -61,7 +61,7 @@ Get the current worker for a project, including the worker version, SDK version,
### trigger_task
Trigger a task to run with a specific payload. You can add a delay, set tags, configure retries, choose a machine size, set a TTL, or use an idempotency key.
Trigger a task to run with a specific payload. You can add a delay, set tags, configure retries, choose a machine size, pick a region, set a TTL, or use an idempotency key.
**Example usage:**
- `"Run the email-notification task"`
+6
View File
@@ -100,6 +100,12 @@ export const TriggerTaskInput = CommonProjectsInput.extend({
.number()
.describe("The maximum duration in seconds of the task run")
.optional(),
region: z
.string()
.describe(
"The region to run the task in, overriding the default region set for the project. Available regions are listed on the Regions page in the dashboard, and this has no effect in the dev environment"
)
.optional(),
tags: z
.array(z.string())
.describe(