Skip to main content
Glama
JustParent

simple-salesforce-mcp

by JustParent

run_soql_query

Read-onlyIdempotent

Run raw SOQL queries to fetch Salesforce records with filtering, joins, aggregates, and ORDER BY. Read-only access supports pagination via next_url; include LIMIT for exploratory queries.

Instructions

Run a raw SOQL query against the Salesforce org. Read-only — SOQL cannot modify data. Use this as the escape hatch for anything the other tools don't cover: filtering, joins via relationship fields, aggregates, ORDER BY. Always include a LIMIT for exploratory queries. If a field or object name errors, check the exact API names with describe_object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSOQL query, e.g. SELECT Id, Name FROM Account WHERE Industry = 'Energy' ORDER BY Name LIMIT 50
next_urlNoPagination cursor: pass the next_url value returned by a previous call to fetch the next page. When set, query is ignored.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

The read-only nature is stated and aligns with the readOnlyHint and idempotentHint annotations. The description adds useful behavioral context by explaining that SOQL cannot modify data, advising LIMIT to avoid runaway exploratory queries, and signaling that invalid field/object names produce errors. It doesn't discuss pagination or result shape, but annotations already cover the safety profile.

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?

Five short, purposeful sentences with the main purpose and read-only caveat front-loaded. Every sentence earns its place: purpose, safety, use cases, LIMIT guidance, and error recovery. No filler.

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

Completeness4/5

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

For a general-purpose SOQL tool with two parameters and no output schema, the description covers the essential context: scope, capabilities, safety, usage guardrails, and error handling. Pagination is documented in the schema's next_url description, so the absence of that detail in the tool description is acceptable.

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 schema already provides 100% parameter coverage for query and next_url, so the baseline is 3. The description adds practical value by reinforcing the need for LIMIT in queries and pointing to describe_object for resolving invalid API names, which goes slightly beyond the schema.

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?

Description opens with a specific verb and resource: 'Run a raw SOQL query against the Salesforce org.' It also names the tool's role as the escape hatch for filtering, joins, aggregates, and ORDER BY, which clearly distinguishes it from sibling tools like search_records, get_record, and describe_object.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'anything the other tools don't cover,' and gives concrete use cases. It also gives a guardrail ('Always include a LIMIT for exploratory queries') and tells the agent what to do on errors ('check the exact API names with describe_object').

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