Skip to main content
Glama
sunny980123

Salesforce MCP Server

by sunny980123

Retrieve Salesforce Metadata

salesforce_retrieve_metadata
Read-onlyIdempotent

Retrieve a Salesforce metadata component (e.g., Flow, ApexClass) as XML for inspection or reference before redeployment.

Instructions

Retrieve a metadata component (Flow, ApexClass, ValidationRule, etc.) from the Salesforce org as XML via SF CLI.

Use this to:

  • Inspect an existing Flow's XML as a reference before authoring a new one

  • Fetch a component, modify the XML, then redeploy via salesforce_deploy_metadata

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

Args:

  • metadata_type: The type of metadata to retrieve

  • api_name: Metadata API name

  • object_name: Required for ValidationRule (parent sObject)

Requires SALESFORCE_SF_CLI_USERNAME. This tool is read-only — allowed even under SALESFORCE_READONLY.

Returns: The raw *-meta.xml content (and .cls/.trigger body for Apex).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_nameYesMetadata API name
object_nameNoParent sObject API name — required for ValidationRule
metadata_typeYesMetadata type. Supported: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint; the description adds that the tool is safe for read-only mode and specifies the return format (raw XML, .cls/.trigger body) and prerequisites (SALESFORCE_SF_CLI_USERNAME). No contradictions with annotations.

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?

The description is well-structured with a clear first line, bullet points for usage, a list of supported types, and separate sections for args, requirements, and return value. Every sentence serves a purpose, and there is no redundancy.

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

Completeness5/5

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

Given no output schema, the description compensates by stating the return format. It covers all parameters, prerequisites, and usage patterns. The tool has moderate complexity, and the description provides sufficient context for an agent to select and invoke it correctly.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents each parameter. The description restates the object_name requirement but does not add new semantic information beyond what the schema provides.

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?

The description clearly states the tool retrieves a metadata component as XML via SF CLI, lists specific use cases (inspect existing Flow, fetch, modify, redeploy), and enumerates supported metadata types. This provides a specific verb+resource and distinguishes it from sibling tools like salesforce_query or salesforce_deploy_metadata.

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

Usage Guidelines4/5

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

The description provides explicit use cases ('Use this to:') and notes the prerequisite environment variable. While it does not explicitly exclude other contexts, the listed use cases and the context of sibling tools make it clear when to use this tool versus alternatives.

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