run_soql_query
Execute a SOQL query against Salesforce to retrieve data. Supports CSV, compact, or JSON output formats.
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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "run_soql_query"
}
}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 |