Skip to content

Commit 125a478

Browse files
committed
feat(cli): add region filter to the MCP list_runs tool
Adds a region input to list_runs that filters by the worker instance group masterQueue identifier, and surfaces each run's executing region in the formatted output line (e.g. region:us-east-1). Pairs with the matching region filter on the public runs list API.
1 parent 36ccf22 commit 125a478

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

.changeset/mcp-list-runs-region.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
MCP `list_runs` tool: add a `region` filter input and surface each run's executing region in the formatted summary.

packages/cli-v3/src/mcp/formatters.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ function formatRunSummary(run: ListRunResponseItem): string {
427427
parts.push(`v${run.version}`);
428428
}
429429

430+
// Region if available
431+
if (run.region) {
432+
parts.push(`region:${run.region}`);
433+
}
434+
430435
return parts.join(" | ");
431436
}
432437

packages/cli-v3/src/mcp/schemas.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ export const ListRunsInput = CommonProjectsInput.extend({
183183
.describe("Filter for runs created in the last N time period. e.g. 7d, 30d, 365d")
184184
.optional(),
185185
machine: MachinePresetName.describe("Filter for runs that match this machine preset").optional(),
186+
region: z
187+
.string()
188+
.describe(
189+
"Filter for runs that executed in this region (the worker instance group masterQueue identifier, e.g. 'us-east-1' or 'main')"
190+
)
191+
.optional(),
186192
});
187193

188194
export type ListRunsInput = z.output<typeof ListRunsInput>;

packages/cli-v3/src/mcp/tools/runs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ export const listRunsTool = {
374374
to: $to,
375375
period: input.period,
376376
machine: input.machine,
377+
region: input.region,
377378
});
378379

379380
const formattedRuns = formatRunList(result);

0 commit comments

Comments
 (0)