Salesforce Metadata Query
salesforce_metadata_queryExecute 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
| Name | Required | Description | Default |
|---|---|---|---|
| soql | Yes | SOQL query string targeting Tooling API objects (e.g., SELECT Id, ValidationName FROM ValidationRule) | |
| limit | No | Maximum number of records to return (default: 20) | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |