Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Salesforce Validation Rule

sf_create_validation_rule
Idempotent

Create or update Salesforce validation rules on any object via Metadata API. Define error formulas that return TRUE for invalid data to enforce data quality.

Instructions

Creates or updates a Salesforce Validation Rule on any object via the Metadata API. The errorConditionFormula returns TRUE when data is INVALID. Use for data quality enforcement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activeNoWhether the rule is active
ruleNameYesAPI name for the rule, e.g. 'Require_Close_Date'
objectNameYesObject API name, e.g. 'Account', 'Opportunity', 'Invoice__c'
descriptionNoDescription of this validation rule
errorMessageYesError shown to user when validation fails (max 255 chars)
errorDisplayFieldNoField API name to display error next to, e.g. 'CloseDate'. Blank = top of page.
errorConditionFormulaYesFormula returning TRUE when data is INVALID, e.g. "AND(ISPICKVAL(StageName,'Closed Won'),ISBLANK(CloseDate))"
Behavior4/5

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

The description adds valuable behavior beyond annotations: it reveals the tool is an upsert ('Creates or updates'), explains the key formula semantics (TRUE = invalid), and names the API method (Metadata API). Annotations already cover read-only/destructive/idempotent flags, so the description complements rather than repeats them.

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?

Three short sentences: the first states the action and scope, the second clarifies the core formula behavior, and the third gives the primary use case. No filler or repetition.

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?

With a fully described schema and solid annotations, the description is adequately complete. It covers the main behavioral nuance (upsert and formula direction) and use case. It could optionally mention permissions or deployment impact, but the lack is not a glaring gap.

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 description coverage is 100%, so the baseline is 3. The description mentions errorConditionFormula semantics, but this is essentially identical to the schema description and does not add extra parameter meaning.

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 states a specific action ('Creates or updates') and resource ('Salesforce Validation Rule') plus scope ('on any object via the Metadata API'). It clearly distinguishes from sibling tools by naming the metadata type and its use for data quality enforcement.

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?

'Use for data quality enforcement' provides clear context for when to invoke the tool, but it does not explicitly exclude alternatives or name sibling tools (e.g., workflow rules) for comparison. Thus it earns a 4 rather than a 5.

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/semwalajay83-sem/salesforce-metadata-mcp'

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