Repository navigation
feat(m28): deterministic run queue overview (MCP tool) - #50
Conversation
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
Reviewer's GuideImplements the missing TypeScript MCP tool for the deterministic run queue overview by adding a zod-backed input schema and registering a new MCP tool that proxies to the existing daemon handler Sequence diagram for the new get_run_queue_overview MCP toolsequenceDiagram
actor Agent
participant McpServer
participant Tool_get_run_queue_overview
participant DaemonClient
participant Daemon_runs_overview
Agent->>McpServer: invoke get_run_queue_overview(params)
McpServer->>Tool_get_run_queue_overview: dispatch with params
Tool_get_run_queue_overview->>DaemonClient: call runs.overview
DaemonClient->>Daemon_runs_overview: runs.overview(workspaceId, includeArchived, includeSnoozed, today)
Daemon_runs_overview-->>DaemonClient: overviewSummary
DaemonClient-->>Tool_get_run_queue_overview: overviewSummary
Tool_get_run_queue_overview-->>McpServer: content[{type: text, text: JSON.stringify(overviewSummary)}]
McpServer-->>Agent: tool result
Updated class diagram for MCP server, daemon client, and GetQueueOverviewInputclassDiagram
class GetQueueOverviewInput {
string workspaceId
boolean includeArchived
boolean includeSnoozed
string today
}
class McpServer {
+tool(name, description, inputSchema, handler)
}
class DaemonClient {
+call(methodName, params) Promise
}
class ToolHandler_get_run_queue_overview {
+handle(params) Promise
}
McpServer "1" o-- "many" ToolHandler_get_run_queue_overview : registers
ToolHandler_get_run_queue_overview --> GetQueueOverviewInput : uses
ToolHandler_get_run_queue_overview --> DaemonClient : calls
DaemonClient --> Daemon_runs_overview : invokes
class Daemon_runs_overview {
+runs_overview(workspaceId, includeArchived, includeSnoozed, today) OverviewSummary
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In the
get_run_queue_overviewtool handler you can passparamsdirectly toclient.call("runs.overview", ...)instead of re-listing each field, which will make it easier to keep the tool input and daemon call in sync if the schema changes. - The description string for
get_run_queue_overviewis quite long and enumerates many internal categories; consider shortening or referencing the daemon’s semantics instead of duplicating all categories to reduce future drift.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `get_run_queue_overview` tool handler you can pass `params` directly to `client.call("runs.overview", ...)` instead of re-listing each field, which will make it easier to keep the tool input and daemon call in sync if the schema changes.
- The description string for `get_run_queue_overview` is quite long and enumerates many internal categories; consider shortening or referencing the daemon’s semantics instead of duplicating all categories to reduce future drift.
## Individual Comments
### Comment 1
<location path="apps/chatgpt-mcp/src/schemas.ts" line_range="621-624" />
<code_context>
+
+/** Input schema for `get_run_queue_overview`. */
+export const GetQueueOverviewInput = {
+ workspaceId: z
+ .string()
+ .optional()
+ .describe("Filter by workspace path"),
+ includeArchived: z
+ .boolean()
</code_context>
<issue_to_address>
**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:
```typescript
/** 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.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| workspaceId: z | ||
| .string() | ||
| .optional() | ||
| .describe("Filter by workspace path"), |
There was a problem hiding this comment.
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"),- Update all usages of this schema where
GetQueueOverviewInputis referenced so that they readworkspacePathinstead ofworkspaceId(e.g. request builders, handlers, and any TypeScript types inferred from this schema). - If this schema is serialized over the wire (e.g. JSON payloads), update the corresponding client/server contracts and tests to use
workspacePathas the field name.
There was a problem hiding this comment.
Pull request overview
Adds a new MCP tool to expose the daemon’s runs.overview method through the TypeScript MCP gateway, including a new Zod input schema for filtering and overdue calculations.
Changes:
- Register a new MCP tool
get_run_queue_overviewthat calls the daemon methodruns.overview. - Add
GetQueueOverviewInputschema to validate tool parameters (workspace filter, includeArchived/includeSnoozed, optionaltoday).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/chatgpt-mcp/src/tools.ts | Registers get_run_queue_overview MCP tool wired to daemon runs.overview. |
| apps/chatgpt-mcp/src/schemas.ts | Introduces GetQueueOverviewInput Zod schema for the new tool’s parameters. |
You can also share your feedback on Copilot code review. Take the survey.
| // runs.overview (Milestone 24/28) | ||
| server.tool( | ||
| "get_run_queue_overview", | ||
| "Get a deterministic queue overview summary with compact counts: " + |
| "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.", |
| return { | ||
| content: [{ type: "text", text: JSON.stringify(result, null, 2) }], | ||
| }; |
| today: z | ||
| .string() | ||
| .regex(/^\d{4}-\d{2}-\d{2}$/, "must be YYYY-MM-DD") | ||
| .optional() | ||
| .describe("ISO date for computing overdue counts"), |
Summary
Add the MCP tool for run queue overview to complete Milestone 28.
The daemon handler was already implemented in M24 (runs.overview), but the TypeScript MCP tool was missing. This PR adds:
GetQueueOverviewInputschema in schemas.tsget_run_queue_overviewtool registration in tools.tsVerification
Related
Summary by Sourcery
Add a new MCP tool to expose a deterministic run queue overview backed by the existing daemon runs.overview handler.
New Features: