Skip to main content
Glama
sunny980123

Salesforce MCP Server

by sunny980123

Salesforce Metadata Query

salesforce_metadata_query
Read-onlyIdempotent

Execute SOQL queries with the Salesforce Tooling API to retrieve metadata objects like ValidationRules, Flows, and ApexClasses not accessible via standard SOQL.

Instructions

Execute a SOQL query using the Salesforce Tooling API to access metadata objects not available via standard SOQL.

Use for: ValidationRule, Flow/FlowVersionView, ApexClass/ApexTrigger, WorkflowRule, FieldDefinition.

Examples:

  • SELECT Id, ValidationName, Active, EntityDefinitionId FROM ValidationRule

  • SELECT Id, MasterLabel, Status, VersionNumber FROM Flow WHERE Status = 'Active'

  • SELECT Id, MasterLabel, Metadata FROM Flow WHERE Id = '301xx...'

  • SELECT Id, Name, Body FROM ApexClass WHERE Name = 'MyClass'

Note: Queries with Metadata or FullName fields must return exactly 1 row (use WHERE Id = '...')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
soqlYesSOQL query string targeting Tooling API objects (e.g., SELECT Id, ValidationName FROM ValidationRule)
limitNoMaximum number of records to return (default: 20)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
Behavior4/5

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

The description adds critical behavioral context beyond annotations: it specifies use of the Tooling API, the restriction on Metadata/FullName fields requiring exactly one row, and implies it complements standard SOQL. No contradiction with annotations (readOnlyHint, etc.).

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 concise: a clear opening statement, targeted use cases, representative examples, and a critical constraint note. Every sentence serves a purpose with 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 the tool's complexity and lack of output schema, the description is comprehensive. It covers purpose, applicable objects, examples, and the key single-row constraint, enabling correct agent invocation.

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 adds usage examples for the soql parameter but does not significantly enhance meaning beyond the schema for limit and response_format.

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 executes SOQL queries using the Salesforce Tooling API for metadata objects, with specific objects listed and examples. It distinguishes from siblings like salesforce_query by explicitly noting it accesses metadata not available via standard SOQL.

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 (e.g., ValidationRule, Flow) and examples, and notes the single-row constraint for Metadata/FullName fields. However, it lacks explicit 'when not to use' or comparison to alternative tools like salesforce_describe_object or salesforce_retrieve_metadata.

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