Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 19, 2026

Summary

  • updated mcp subblocks for mcp tools to match subblocks
  • added dividers instead of spaces to match the other subblocks

Type of Change

  • Refactor

Testing

Tested manually

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)

@vercel
Copy link

vercel bot commented Jan 19, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 19, 2026 5:40pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 19, 2026

Greptile Summary

This PR refactors the MCP dynamic arguments component to use the established ShortInput and LongInput subblock components instead of custom-built McpInputWithTags and McpTextareaWithTags components.

Key Changes:

  • Removed ~270 lines of duplicate input/textarea implementation code
  • Replaced custom components with ShortInput and LongInput from the subblock components library
  • Added createParamConfig helper to generate minimal SubBlockConfig objects for MCP parameters
  • Standardized layout structure using subblock-row, subblock-content, and subblock-divider CSS classes matching the pattern in editor.tsx
  • Updated console logging to use the logger instance consistently
  • Removed unused imports (Input, Textarea, formatDisplayText, TagDropdown, useAccessibleReferencePrefixes)

The refactoring improves code maintainability by reusing existing components with tag dropdown, drag-and-drop, and formatting features already built-in.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes represent a clean refactoring that eliminates code duplication by leveraging existing, well-tested subblock components (ShortInput/LongInput). The component interface remains the same, functionality is preserved through proper prop mapping, and the code follows established patterns from editor.tsx. No logic changes or new features were introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/mcp-dynamic-args/mcp-dynamic-args.tsx Refactored to use reusable ShortInput/LongInput components instead of custom implementations, standardized layout with subblock-row/subblock-content structure matching editor.tsx pattern

Sequence Diagram

sequenceDiagram
    participant User
    participant McpDynamicArgs
    participant ShortInput
    participant LongInput
    participant SubBlockInputController
    participant useSubBlockValue
    
    User->>McpDynamicArgs: Interact with parameter input
    
    alt Short text/number parameter
        McpDynamicArgs->>McpDynamicArgs: createParamConfig(paramName, schema, 'short-input')
        McpDynamicArgs->>ShortInput: Pass config, blockId, subBlockId
        ShortInput->>SubBlockInputController: Handle input, tags, drag-drop
        SubBlockInputController->>useSubBlockValue: Update parameter value
        useSubBlockValue->>McpDynamicArgs: Value updated in toolArgs
    else Long text/array parameter
        McpDynamicArgs->>McpDynamicArgs: createParamConfig(paramName, schema, 'long-input')
        McpDynamicArgs->>LongInput: Pass config, blockId, subBlockId
        LongInput->>SubBlockInputController: Handle input, tags, drag-drop
        SubBlockInputController->>useSubBlockValue: Update parameter value
        useSubBlockValue->>McpDynamicArgs: Value updated in toolArgs
    end
    
    McpDynamicArgs->>McpDynamicArgs: updateParameter(paramName, value)
    McpDynamicArgs->>useSubBlockValue: setToolArgs(updated)
Loading

@waleedlatif1 waleedlatif1 merged commit 932f8fd into staging Jan 19, 2026
6 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/slack branch January 19, 2026 17:50
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.

2 participants