Add formFactors parameter to create_app Salesforce MCP tool

Resolved 💬 2 comments Opened Nov 23, 2025 by CharlesCage Closed Nov 23, 2025

Feature Request

Add formFactors parameter to mcp__salesforce-metadata__create_app tool to support Lightning Experience by default.

Problem

The create_app tool creates Classic apps by default, which don't appear in Lightning Experience App Launcher. This requires a follow-up call to update_metadata to add formFactors, making the workflow unnecessarily complex.

Current Workflow (2 steps)

# Step 1: Create app (Classic by default)
create_app(
    appName="Pet_Adoption",
    label="Pet Adoption",
    tabs=["Animal__c", "Medical_Record__c"]
)

# Step 2: Update to make it Lightning-compatible
update_metadata(
    metadataType="CustomApplication",
    fullName="Pet_Adoption",
    updates={"formFactors": ["Large"]}
)

Problem: The app exists but is invisible between steps 1 and 2, causing confusion.

Proposed Solution

Add formFactors parameter with sensible defaults:

mcp__salesforce-metadata__create_app(
    appName="Pet_Adoption",
    label="Pet Adoption",
    tabs=["Animal__c", "Medical_Record__c"],
    formFactors=["Large"]  # ← New parameter (default: ["Large"])
)

Implementation Details

Parameter specification:

  • formFactors (optional, default: ["Large"])
  • Valid values: ["Large"], ["Small"], ["Large", "Small"]
  • Large = Desktop Lightning Experience
  • Small = Mobile app

Default behavior change:

  • Current: Creates Classic app (no formFactors)
  • Proposed: Creates Lightning app (formFactors=["Large"])
  • Rationale: 95%+ of Salesforce orgs use Lightning Experience

Backward compatibility:

  • Allow formFactors=None or formFactors=[] for Classic apps
  • Document when Classic-only apps are appropriate

Example Use Cases

Lightning desktop app (most common):

create_app(appName="My_App", label="My App", tabs=[...])
# Automatically includes formFactors=["Large"]

Desktop + Mobile app:

create_app(
    appName="My_App",
    label="My App", 
    tabs=[...],
    formFactors=["Large", "Small"]
)

Classic app (rare):

create_app(
    appName="Legacy_App",
    label="Legacy App",
    tabs=[...],
    formFactors=None  # Explicitly opt into Classic
)

User Impact

High - Affects all custom app creation:

  • Current: Apps invisible by default in Lightning
  • Proposed: Apps work immediately in Lightning
  • Reduces confusion and troubleshooting time
  • Aligns with Salesforce best practices (Lightning-first)

Technical Details

Metadata API CustomApplication structure:

<CustomApplication>
    <label>Pet Adoption</label>
    <formFactors>
        <formFactor>Large</formFactor>
    </formFactors>
    <tabs>
        <tab>Animal__c</tab>
        <tab>Medical_Record__c</tab>
    </tabs>
</CustomApplication>

Related Issues

  • #12213 - Lightning Experience best practice documentation
  • Related to profile visibility assignment issue

Acceptance Criteria

  • [ ] formFactors parameter available in create_app
  • [ ] Defaults to ["Large"] for Lightning compatibility
  • [ ] Supports ["Small"] for mobile
  • [ ] Supports ["Large", "Small"] for both
  • [ ] Allows None or [] for Classic apps
  • [ ] Documentation updated with examples
  • [ ] Tests cover all formFactor combinations

References

Breaking Change Consideration

Recommendation: Make this a breaking change with clear migration path:

  • Old behavior: No formFactors (Classic)
  • New behavior: formFactors=["Large"] by default (Lightning)
  • Migration: Users wanting Classic must explicitly pass formFactors=None

This is justified because:

  1. Lightning is the standard (Classic is legacy)
  2. Current behavior causes more problems than it solves
  3. Easy opt-out for rare Classic use cases

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗