Query Records (SOQL)
sf_query_recordsRun SOQL queries to read Salesforce records, check existing data before creating, and verify changes. Supports aggregate queries like COUNT, SUM, and GROUP BY for data analysis.
Instructions
Executes a SOQL query against the org and returns matching records. Provide the full SOQL string in the query param. Use for reading data, checking existing records before creating, or verifying changes.
Supports aggregate queries — GROUP BY with COUNT(), SUM(), AVG(), MAX(), MIN(), e.g.: 'SELECT StageName, COUNT(Id), SUM(Amount) FROM Opportunity GROUP BY StageName' Aggregate results come back as regular records with the aggregate expressions as field keys (e.g. "expr0").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to return (default 200) | |
| query | Yes | Full SOQL query string, e.g. 'SELECT Id, Name FROM Account WHERE Industry = \'Technology\' LIMIT 10' |