Skip to main content
Glama
smn2gnt

MCP Salesforce Connector

by smn2gnt

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

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SOQL query to execute. Always include LIMIT clause and select only needed fields.
formatNoOutput format: 'csv' (default, most compact), 'compact' (JSON no whitespace), 'json' (full JSON)csv
Behavior3/5

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

No annotations are provided, so the description must convey behavioral traits. It implies a read-only operation by executing a query, but it does not explicitly state that it does not modify data or mention any side effects. The description adds context about token efficiency but lacks explicit disclosure of read-only nature.

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-structured: first sentence states purpose, followed by a bullet-point list of guidelines, and ends with an example. Every sentence provides useful information for efficient tool usage, with no unnecessary 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 that the schema fully documents both parameters and sibling tools include similar data access tools, the description provides sufficient context for proper tool selection and invocation. The guidelines cover efficient query construction and output format options.

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?

The input schema has 100% coverage for its 2 parameters. The description adds value by explaining the format default and when to use alternate output formats, and provides guidance on writing efficient queries (select only needed fields, LIMIT, WHERE). This goes beyond the schema definitions.

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 'Executes a SOQL query against Salesforce.' This specifies the action (executes), the resource (SOQL query against Salesforce), and differentiates it from sibling tools like run_sosl_search, get_record, and data mutation tools.

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 provides 'TOKEN OPTIMIZATION GUIDELINES' with best practices: select needed fields, use LIMIT, WHERE clauses, and default CSV output. It also gives an example efficient query. However, it does not explicitly mention when not to use this tool (e.g., for SOSL searches or simple record lookups).

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/smn2gnt/MCP-Salesforce'

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