From 68078a7631a93c09299212d3d80692683ba80035 Mon Sep 17 00:00:00 2001 From: anschmieg <6830368+anschmieg@users.noreply.github.com> Date: Wed, 18 Mar 2026 13:25:21 +0100 Subject: [PATCH] feat(m28): add MCP tool for run queue overview Add get_run_queue_overview tool to the TypeScript MCP gateway. The daemon handler was already implemented in M24. - Add GetQueueOverviewInput schema - Register get_run_queue_overview tool - No backend autonomy added --- apps/chatgpt-mcp/src/schemas.ts | 25 +++++++++++++++++++++++++ apps/chatgpt-mcp/src/tools.ts | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/apps/chatgpt-mcp/src/schemas.ts b/apps/chatgpt-mcp/src/schemas.ts index b4d0ff7afae4..5da459492feb 100644 --- a/apps/chatgpt-mcp/src/schemas.ts +++ b/apps/chatgpt-mcp/src/schemas.ts @@ -611,3 +611,28 @@ export const SetRunDueDateInput = { "No time-of-day or timezone semantics; the backend stores the date string as-is.", ), }; + +// --------------------------------------------------------------- +// GetQueueOverviewInput (Milestone 24) +// --------------------------------------------------------------- + +/** Input schema for `get_run_queue_overview`. */ +export const GetQueueOverviewInput = { + workspaceId: z + .string() + .optional() + .describe("Filter by workspace path"), + includeArchived: z + .boolean() + .optional() + .describe("When true, archived runs are included in counts (default: false)"), + includeSnoozed: z + .boolean() + .optional() + .describe("When true, snoozed runs are included in counts (default: false)"), + today: z + .string() + .regex(/^\d{4}-\d{2}-\d{2}$/, "must be YYYY-MM-DD") + .optional() + .describe("ISO date for computing overdue counts"), +}; diff --git a/apps/chatgpt-mcp/src/tools.ts b/apps/chatgpt-mcp/src/tools.ts index d8197a01ebcc..7ba53064d5a6 100644 --- a/apps/chatgpt-mcp/src/tools.ts +++ b/apps/chatgpt-mcp/src/tools.ts @@ -41,6 +41,7 @@ import { SetRunPriorityInput, AssignRunOwnerInput, SetRunDueDateInput, + GetQueueOverviewInput, } from "./schemas.js"; /** @@ -631,4 +632,24 @@ export function registerTools(server: McpServer, client: DaemonClient): void { }; }, ); + + // runs.overview (Milestone 24/28) + server.tool( + "get_run_queue_overview", + "Get a deterministic queue overview summary with compact counts: " + + "total visible runs, ready, blocked, deferred, done, attention, urgent, overdue, stale, pinned, assigned vs unassigned. " + + "This is a read-only inspection operation that derives summary counts from existing run state without mutating anything.", + GetQueueOverviewInput, + async (params) => { + const result = await client.call("runs.overview", { + workspaceId: params.workspaceId, + includeArchived: params.includeArchived, + includeSnoozed: params.includeSnoozed, + today: params.today, + }); + return { + content: [{ type: "text", text: JSON.stringify(result, null, 2) }], + }; + }, + ); }