improvement(workflow-mcp): single-source MCP tool params, deploy status, chip styling#5029
improvement(workflow-mcp): single-source MCP tool params, deploy status, chip styling#5029waleedlatif1 wants to merge 7 commits into
Conversation
…us, chip styling - Make the start block input format the single source of truth for MCP tool parameter descriptions; the deploy modal writes them back collaboratively so they persist with the workflow and survive redeploys (fixes descriptions getting wiped on workflow edits) - Derive the tool parameter schema from the deployed workflow instead of the draft, so a saved tool can never advertise params the running workflow lacks - Add a Live / Update deployment status badge to the MCP tab, mirroring A2A - Swap the legacy Textarea for ChipTextarea on the tool Description - Extract the duplicated isDefaultDescription helper into one shared util
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Shared Copilot Reviewed by Cursor Bugbot for commit a425646. Configure here. |
Greptile SummaryThis PR collapses three competing sources of truth for MCP tool parameter descriptions into one: the start block's
Confidence Score: 5/5Safe to merge — changes are well-scoped DRY refactors with a clearly established server-side mutation pattern and targeted test coverage for the new description-persistence path. The server-side persistParameterDescriptionsToStartBlock follows the same load→mutate→save→notify pattern already used by edit-workflow and other copilot handlers, and its WorkflowState construction correctly includes all required fields (TypeScript confirmed at compile time). The collaborative UI path is a straightforward swap from local state to subblock-store writes, guarded by the same pickRawInputFormat fallback logic that was already reviewed and fixed in the previous round. No new required-field types, DB schema changes, or auth boundaries are touched. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as MCP Deploy Panel
participant CH as collaborativeSetSubblockValue
participant RT as Realtime Socket
participant DB as Normalized Tables (DB)
participant CP as Copilot deploy_mcp handler
Note over UI,RT: UI path — description edited in panel
UI->>CH: updateFieldDescription(fieldName, value)
CH->>RT: broadcast inputFormat update
RT-->>DB: persist subblock value
Note over CP,DB: Copilot path — deploy_mcp tool call
CP->>DB: getDeployedWorkflowInputFormat(workflowId)
DB-->>CP: deployed input fields
CP->>DB: loadWorkflowFromNormalizedTables(workflowId)
DB-->>CP: draft WorkflowState
CP->>CP: map descriptions onto start block fields
CP->>DB: saveWorkflowToNormalizedTables(workflowId, nextState)
CP->>RT: notifyWorkflowUpdated(workflowId)
CP->>CP: generateParameterSchema(inputFormat, descriptions)
CP->>DB: performCreateWorkflowMcpTool / performUpdateWorkflowMcpTool
Reviews (7): Last reviewed commit: "fix(workflow-mcp): surface legacy tool p..." | Re-trigger Greptile |
…aram descriptions updateFieldDescription read only from the subblock store, but the display memo falls back to the block's persisted inputFormat when the store entry is empty. For workflows whose fields are hydrated from block defaults, editing a description would have written [] and wiped every input field. Extract a shared resolveInputFormatFields helper used by both the memo and the writer, and guard against ever persisting an empty list.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fdc2679. Configure here.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 17f6a0a. Configure here.
… descriptions Map over the raw input-format array instead of the normalized one so editing a parameter description no longer drops unnamed/in-progress fields from the start block.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 34312fd. Configure here.
…le on the start block Align the copilot deploy_mcp tool with the UI's single-source model: per-parameter descriptions are now persisted onto the workflow's draft start block input format (their durable home) so a later redeploy regenerates the tool schema from them instead of wiping them. The tool schema is still set directly so descriptions take effect immediately without a redeploy; both paths converge on the next deploy. Also consolidate the duplicated socket-notify into a shared notifyWorkflowUpdated helper used by the deploy handler, the workflow mutation handlers, and edit-workflow.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c44cddf. Configure here.
Adds deploy.test.ts (the handler previously had no test) covering: descriptions written to the draft start block + socket notify, no-op when none supplied, no-op when unchanged, and ignoring descriptions for fields absent from the start block.
|
@greptile |
|
@cursor review |
…y fallback Tools saved before descriptions moved to the start block store them only on the tool schema. Show those as a fallback when the start block field has none, so they stay visible; editing one writes through to the start block (migrating it durably).
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a425646. Configure here.
Summary
Live/Update deploymentstatus badge to the MCP tab, mirroring the A2A tab, so drift between the tool and the deployed workflow is visible and actionableTextareaforChipTextareaon the tool Description (it predatedChipTextareaand was never migrated)isDefaultDescriptionhelper (copy-pasted across the MCP, A2A, and API-info surfaces) into one shared utilContext
The MCP tab had three competing sources of truth for parameter descriptions (start block, a private modal overlay, and the saved tool schema) that silently overwrote each other. The result: descriptions wiped on every redeploy, and a "Save Tool" that could push a param set different from what the deployed workflow actually runs. This collapses everything to one rule: the MCP tool always mirrors the deployed workflow.
Type of Change
Testing
Tested manually; typecheck, lint, and `check:api-validation` pass.
Follow-up (not in this PR)
Checklist