run_soql_query
Query Salesforce data by executing SOQL queries with selective fields, filters, and limits to conserve tokens.
Instructions
Executes a SOQL query against Salesforce.
TOKEN OPTIMIZATION GUIDELINES:
Always SELECT only the fields you need (never SELECT *)
Use LIMIT to restrict results (start with LIMIT 10, increase if needed)
Use WHERE clauses to filter data server-side
Default output is CSV format (most token-efficient)
Use format='json' only when you need nested data structure
You can always run additional queries if you need more data
Example efficient query: SELECT Id, Name FROM Account WHERE IsActive = true LIMIT 20
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SOQL query to execute. Always include LIMIT clause and select only needed fields. | |
| format | No | Output format: 'csv' (default, most compact), 'compact' (JSON no whitespace), 'json' (full JSON) | csv |