Skip to main content
Glama
sunny980123

Salesforce MCP Server

by sunny980123

Deploy Salesforce Metadata

salesforce_deploy_metadata

Upsert metadata components such as Flows, ApexClasses, and ValidationRules to Salesforce via the SF CLI. Perform a dry-run to validate changes before deployment.

Instructions

Deploy a metadata component (Flow, ApexClass, ValidationRule, etc.) to the Salesforce org via the SF CLI.

Use this to create OR update declarative metadata. Salesforce deploy is upsert-style: if 'api_name' already exists in the org, this overwrites it.

Typical workflow for creating a new Flow:

  1. (Optional) salesforce_retrieve_metadata to pull an existing Flow as a template

  2. Author the Flow XML (...)

  3. Call this tool with check_only=true to validate (dry-run)

  4. Re-run with check_only=false to actually deploy

Supported metadata types: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject

Args:

  • metadata_type: One of the supported types above.

  • api_name: Metadata API name, e.g. 'My_New_Flow'. Must match Salesforce naming rules.

  • xml_content: Full *-meta.xml content. For Flows, a complete document.

  • body_content: Required for ApexClass (.cls body) and ApexTrigger (.trigger body).

  • object_name: Required for ValidationRule — parent sObject (e.g. 'Account').

  • check_only: If true, validate without committing (dry-run). Default: false.

Blocked entirely when SALESFORCE_READONLY=true (including dry-runs). Requires SALESFORCE_SF_CLI_USERNAME and the Salesforce user to have metadata deploy permissions (e.g. 'Customize Application' or 'Modify Metadata Through Metadata API Functions').

Returns: Deploy status with per-component successes and failures (with error messages).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_nameYesMetadata API name (e.g., My_New_Flow)
check_onlyNoValidate only (dry-run). Default: false
object_nameNoParent sObject API name — required for ValidationRule
xml_contentYesFull *-meta.xml content for the component
body_contentNoBody text — required for ApexClass (.cls) and ApexTrigger (.trigger)
metadata_typeYesMetadata type. Supported: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that deploy is upsert-style (overwrites existing api_name), blocked when SALESFORCE_READONLY=true (including dry-runs), and requires specific permissions. Adds context beyond annotations (readOnlyHint=false, openWorldHint=true) without contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a clear one-sentence summary, then organized into upsert behavior, workflow, supported types, parameter details, blocking conditions, and returns. Every sentence adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, workflow, parameters, blocking, permissions, return status. Lacks explicit details on return format or how unused parameters are handled per metadata type, but overall comprehensive given complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds significant context beyond the 100% schema coverage: e.g., 'api_name must match Salesforce naming rules'; 'body_content required for ApexClass and ApexTrigger'; workflow guidance for check_only. Schema descriptions are adequate, but the narrative enriches understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool deploys a metadata component to Salesforce via SF CLI, specifies upsert behavior (create or update), and lists supported types. Distinguishes from sibling tools like salesforce_retrieve_metadata (retrieve) and salesforce_create_record (records).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides a typical workflow for creating a new Flow, including optional retrieval, authoring, dry-run, and deploy. Notes blocking when SALESFORCE_READONLY=true and required permissions. Implicitly distinguishes from similar tools by focusing on metadata deployment.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sunny980123/Salesforce-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server