Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions apps/chatgpt-mcp/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Comment on lines +621 to +624

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Align workspaceId naming with its description of a workspace path.

If this value is actually a path (e.g. /foo/bar), consider renaming the field (for example to workspacePath). Otherwise, update the description so it clearly refers to an ID. This keeps the API contract unambiguous for callers.

Suggested implementation:

/** Input schema for `get_run_queue_overview`. */
export const GetQueueOverviewInput = {
  workspacePath: z
    .string()
    .optional()
    .describe("Filter by workspace path"),
  1. Update all usages of this schema where GetQueueOverviewInput is referenced so that they read workspacePath instead of workspaceId (e.g. request builders, handlers, and any TypeScript types inferred from this schema).
  2. If this schema is serialized over the wire (e.g. JSON payloads), update the corresponding client/server contracts and tests to use workspacePath as the field name.

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"),
Comment on lines +633 to +637
};
21 changes: 21 additions & 0 deletions apps/chatgpt-mcp/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
SetRunPriorityInput,
AssignRunOwnerInput,
SetRunDueDateInput,
GetQueueOverviewInput,
} from "./schemas.js";

/**
Expand Down Expand Up @@ -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: " +
Comment on lines +636 to +639
"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.",
Comment on lines +639 to +641
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) }],
};
Comment on lines +650 to +652
},
);
}
Loading