Skip to main content
Glama
sunny980123

Salesforce MCP Server

by sunny980123

Salesforce SOQL Query

salesforce_query
Read-onlyIdempotent

Query Salesforce records using SOQL to retrieve data like Accounts, Contacts, or Opportunities with customizable output format.

Instructions

Execute a SOQL (Salesforce Object Query Language) query to retrieve records from Salesforce.

SOQL is similar to SQL. Example queries:

  • SELECT Id, Name, Industry FROM Account WHERE Industry = 'Technology' LIMIT 10

  • SELECT Id, Name, Email FROM Contact WHERE AccountId = '001xx000...'

  • SELECT Id, Name, StageName, Amount FROM Opportunity WHERE CloseDate = THIS_YEAR

Args:

  • soql (string): A valid SOQL query string

  • limit (number): Max records to return from results (default: 20, max: 200)

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: JSON: { totalSize, done, records[], nextRecordsUrl? } Markdown: Formatted table of results

Error: Returns descriptive error if query syntax is invalid or fields don't exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
soqlYesSOQL query string (e.g., SELECT Id, Name FROM Account LIMIT 10)
limitNoMaximum number of records to return (default: 20)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so safety is handled. The description adds value by detailing return formats (JSON/Markdown), error messaging, and the default/max limit for results. This provides behavioral context beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized: first sentence states purpose, then examples, then parameter list, then return info, then error info. Every sentence adds value, and the structure is easy to parse. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a SOQL query tool, the description covers all essential aspects: query language, parameters, return format, and error handling. No output schema is provided, but the text describes the return value sufficiently. It is complete for an AI agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds examples and explains the soql parameter with syntax hints, the limit parameter with defaults, and the response_format parameter with format descriptions. This goes beyond the schema's basic descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it executes a SOQL query to retrieve records, using a specific verb ('Execute') and resource ('Salesforce records'). It provides examples of typical queries, distinguishing it from sibling tools like salesforce_get_record (single record by ID) or salesforce_search (full-text search). No ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use this tool (for SOQL queries) and gives examples of valid use cases. It doesn't explicitly list when not to use it, but the sibling tools implicitly cover alternatives. The context is clear enough for an AI agent to decide.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sunny980123/Salesforce-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server