Skip to content

improvement(workflow-mcp): single-source MCP tool params, deploy status, chip styling#5029

Open
waleedlatif1 wants to merge 4 commits into
stagingfrom
worktree-mcp-deploy-ux
Open

improvement(workflow-mcp): single-source MCP tool params, deploy status, chip styling#5029
waleedlatif1 wants to merge 4 commits into
stagingfrom
worktree-mcp-deploy-ux

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Make the start block's input format the single source of truth for MCP tool parameter descriptions — the deploy modal now 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 rather than the draft, so a saved tool can never advertise params the running workflow doesn't have
  • Add a Live / Update deployment status badge to the MCP tab, mirroring the A2A tab, so drift between the tool and the deployed workflow is visible and actionable
  • Swap the legacy Textarea for ChipTextarea on the tool Description (it predated ChipTextarea and was never migrated)
  • Extract the duplicated isDefaultDescription helper (copy-pasted across the MCP, A2A, and API-info surfaces) into one shared util

Context

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

  • Bug fix
  • Improvement

Testing

Tested manually; typecheck, lint, and `check:api-validation` pass.

Follow-up (not in this PR)

  • The copilot `deploy_mcp` tool still sets parameter descriptions directly on the tool rather than on the start block, so copilot-set descriptions could still be regenerated on redeploy. Aligning it is a separate change on a different surface.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…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
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 13, 2026 8:17pm

Request Review

@cursor

cursor Bot commented Jun 13, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how MCP tool metadata is saved and when descriptions sync to live tools (redeploy-dependent), which can affect external MCP clients until users redeploy.

Overview
MCP deploy now treats the start block input format as the only place for parameter descriptions: edits write back via collaborativeSetSubblockValue, and Save Tool no longer sends a client-built parameterSchema (only name, description, and server selection). The modal adds copy that param descriptions need a redeploy to reach the live tool.

Shared isDefaultDescription replaces duplicated placeholder checks in the MCP, A2A, and API info flows. MCP uses ChipTextarea for the tool description, and the deploy modal MCP footer shows Live / Update deployment when the workflow is exposed on any MCP server (via onExposedChange), matching the A2A tab pattern.

Reviewed by Cursor Bugbot for commit 34312fd. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR consolidates three competing sources of truth for MCP tool parameter descriptions into one: the start block's inputFormat. It also adds a Live / Update deployment badge to the MCP tab, extracts a shared isDefaultDescription helper, and migrates the tool description field from Textarea to ChipTextarea.

  • Single source of truth for param descriptions: updateFieldDescription now writes directly to the start block's inputFormat via collaborativeSetSubblockValue, and parameterSchema is no longer passed on save/update — the server derives the schema from the deployed workflow instead of the client-assembled one.
  • pickRawInputFormat shared helper: Replaces the previous divergent read paths between the display memo and the writer, eliminating the silent-wipe bug from the previous review thread.
  • Status badge + isDefaultDescription extraction: The MCP footer now mirrors the A2A footer with a green/amber badge, and the duplicated default-description check is consolidated into lib/default-description.ts.

Confidence Score: 5/5

Safe to merge — the changes are well-scoped, the previous silent-wipe bug is properly fixed via the shared pickRawInputFormat helper, and no API contracts are broken.

The refactor correctly collapses three competing sources of truth into one write path. The pickRawInputFormat helper ensures both the display memo and the updateFieldDescription writer read the identical source. Removing parameterSchema from save calls is intentional and correct — the server now owns schema derivation from the deployed workflow. No regressions were identified in the shared isDefaultDescription extraction.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp/mcp.tsx Core fix: introduces pickRawInputFormat, updateFieldDescription, and onExposedChange. Removes parameterSchema from save calls and local parameterDescriptions state. Logic is sound; the collaborative write-back on description change is intentional per the PR design.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx Adds mcpToolExposed state and the Live/Update deployment badge in the MCP footer, mirroring the A2A tab pattern. needsRedeployment correctly reflects overall workflow drift.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/lib/default-description.ts New shared utility extracting the isDefaultDescription helper; clean, well-typed, and used by all three deployment tabs.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/a2a/a2a.tsx Replaces local isDefaultDescription with the shared utility; no logic changes beyond the import refactor.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components/api-info-modal.tsx Replaces local default-description logic with the shared utility. The new version also normalizes workflowName to lowercase before comparison, which is a small correctness improvement.

Sequence Diagram

sequenceDiagram
    participant User
    participant McpDeploy
    participant SubBlockStore
    participant WorkflowStore
    participant CollabLayer as Collaborative Layer
    participant Server as API Server

    User->>McpDeploy: Edit param description (ChipInput onChange)
    McpDeploy->>McpDeploy: updateFieldDescription(fieldName, value)
    McpDeploy->>SubBlockStore: getState().getValue(starterBlockId, 'inputFormat')
    McpDeploy->>WorkflowStore: getState().blocks[starterBlockId] (fallback)
    McpDeploy->>McpDeploy: pickRawInputFormat(storeValue, blockFallback)
    McpDeploy->>CollabLayer: collaborativeSetSubblockValue(starterBlockId, 'inputFormat', nextFields)
    CollabLayer-->>SubBlockStore: Update inputFormat with new description

    User->>McpDeploy: Click Save Tool (name/description only)
    McpDeploy->>Server: "updateWorkflowMcpTool({ toolName, toolDescription })"
    Note over Server: parameterSchema derived from deployed workflow, not client

    User->>McpDeploy: Click Deploy (General tab)
    Server-->>McpDeploy: Deployed workflow now matches start block inputFormat
    Note over McpDeploy: needsRedeployment false, Badge shows Live
Loading

Reviews (4): Last reviewed commit: "fix(workflow-mcp): preserve in-progress ..." | 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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant