Skip to main content
Glama
salesforce-mcp

salesforce-mcp

by uoparaji

salesforce_tooling_query

Run SOQL queries against the Salesforce Tooling API to inspect Apex classes, triggers, Visualforce pages, Lightning components, flows, validation rules, and other metadata.

Instructions

Execute a SOQL query against the Tooling API. Use this to inspect Apex classes, triggers, Visualforce pages, Lightning components, flows, validation rules, and other metadata. Example: SELECT Id, Name, Body FROM ApexClass WHERE Name = 'MyClass'

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": "salesforce_tooling_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe Tooling API SOQL query. Queryable objects include: ApexClass, ApexTrigger, ApexPage, ApexComponent, FlowDefinition, Flow, ValidationRule, WorkflowRule, CustomField, CustomObject, AuraDefinitionBundle, LightningComponentBundle, and more.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. "Query" and the example SELECT imply a read-only operation, but it does not state that it is non-mutating, does not mention SOQL row/result limits or whether pagination is needed, and does not note any permission requirements.

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?

Three short sentences: purpose first, then supported object types, then a runnable example. Nothing is redundant and the example earns its space by demonstrating the expected query syntax.

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 one-parameter read tool with full schema coverage and no output schema, the description covers purpose, scope of queryable objects, and query format. The remaining gap is behavioral: result limits, truncation, and whether follow-up paging is required are unaddressed.

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

Parameters3/5

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

Schema coverage is 100% and the single query parameter already lists queryable objects, so the schema does most of the work. The description adds a concrete SELECT example showing clause syntax, which is genuinely useful, but no guidance on field names, limits, or required WHERE clauses for certain tooling objects.

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

Purpose4/5

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

The description states a specific verb and resource ("Execute a SOQL query against the Tooling API") and enumerates the metadata artifacts it targets (Apex classes, triggers, Visualforce pages, Lightning components, flows, validation rules). The phrase "Tooling API" implicitly separates it from the sibling salesforce_query that presumably hits standard objects, but no explicit contrast is drawn.

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?

"Use this to inspect Apex classes, triggers, ... and other metadata" gives clear selection context for the metadata-inspection use case. It stops short of stating exclusions or naming alternatives — e.g., that object/field discovery belongs to salesforce_describe_tooling_object or that large result sets need a paging tool.

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