Skip to main content
Glama
pratapsfdc22-dev

Salesforce AI Agent MCP Server

salesforce_create_validation_rule

Create a validation rule on a Salesforce object to block invalid records by defining a formula and an error message displayed when the formula is true.

Instructions

Create a validation rule on a Salesforce object using the Tooling API. The rule evaluates an error condition formula and displays an error message when the formula returns true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activeNoWhether the rule should be active after creation (default true)
ruleNameYesAPI name for the validation rule (no spaces, e.g. 'Require_Phone_For_Hot_Leads')
objectNameYesSalesforce object API name (e.g. 'Account', 'My_Object__c')
descriptionNoInternal description of the rule's purpose
errorMessageYesError message shown to users when validation fails (e.g. 'Phone is required for Hot leads')
errorDisplayFieldNoAPI name of the field where the error should appear. If omitted, the error appears at the top of the page.
errorConditionFormulaYesSalesforce formula that evaluates to TRUE when the record should be invalid. Example: 'AND(Rating = "Hot", ISBLANK(Phone))'
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the Tooling API and the rule's logic, but it does not disclose important traits such as whether the rule requires deployment, if it is reversible, permission requirements, or what happens on errors. This is a significant gap for a mutation tool.

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 consists of two concise sentences that front-load the primary verb and resource. It provides useful context about the rule's behavior without any waste. Every phrase earns its place.

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

Completeness2/5

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

Despite the tool having 7 parameters and no output schema, the description fails to provide necessary context. It does not mention deployment requirements, permissions, the creation process via Tooling API, or validations on the formula. The schema covers parameters, but the behavioral and operational context is incomplete for a create operation.

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 includes terms like 'error condition formula' and 'error message' that map to parameters, but adds no new meaning beyond the schema. The schema already provides detailed descriptions and examples, so the description does not compensate for any gaps.

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's function: 'Create a validation rule on a Salesforce object using the Tooling API.' It also explains the rule's behavior (evaluates an error condition formula and displays an error message when the formula returns true), which distinguishes it from sibling tools like salesforce_create_custom_field and salesforce_query.

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

Usage Guidelines2/5

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

The description gives no explicit guidance on when to use this tool versus alternatives. It does not mention any 'when' or 'when not' conditions, prerequisites, or reference to sibling tools. The only implied context is that it creates validation rules, but there is no stated use case or exclusions.

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/pratapsfdc22-dev/salesforce-ai-agent-mcp'

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