execute_soql_query
Run SOQL queries against Salesforce to retrieve data. Specify fields and conditions to get matching records, row count, and columns.
Instructions
Execute a SOQL query against Salesforce.
Args: query: The SOQL query string (e.g., 'SELECT Id, Name FROM Account LIMIT 10')
Returns: Dictionary containing query, rows, row_count, and columns.
IMPORTANT: Before constructing SOQL queries, use the get_soql_help() tool to understand: - Basic SOQL syntax and structure - How to write WHERE clauses and filters - Relationship queries (child-to-parent and parent-to-child) - Aggregate functions and GROUP BY - Common patterns and best practices
Important SOQL Rules: 1. CANNOT use SELECT * - You MUST specify column names explicitly 2. Aggregate queries (using COUNT, SUM, AVG, etc.) CANNOT use LIMIT
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||