Skip to main content
Glama
ampcome-mcps

MCP Salesforce Connector

by ampcome-mcps

run_sosl_search

Execute SOSL searches to find Salesforce data across multiple objects and fields using a single query, enabling comprehensive data discovery within the Salesforce platform.

Instructions

Executes a SOSL search against Salesforce

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesThe SOSL search to execute (e.g., 'FIND {John Smith} IN ALL FIELDS')

Implementation Reference

  • Handler function block that executes the SOSL search using simple-salesforce's search method and returns formatted JSON results.
    elif name == "run_sosl_search":
        search = arguments.get("search")
        if not search:
            raise ValueError("Missing 'search' argument")
    
        results = sf_client.sf.search(search)
        return [
            types.TextContent(
                type="text",
                text=f"SOSL Search Results (JSON):\n{json.dumps(results, indent=2)}",
            )
        ]
  • Tool registration in list_tools() including name, description, and input schema requiring a 'search' string parameter.
    types.Tool(
        name="run_sosl_search",
        description="Executes a SOSL search against Salesforce",
        inputSchema={
            "type": "object",
            "properties": {
                "search": {
                    "type": "string",
                    "description": "The SOSL search to execute (e.g., 'FIND {John Smith} IN ALL FIELDS')",
                },
            },
            "required": ["search"],
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but reveals nothing about permissions required, rate limits, error conditions, response format, or whether this is a read-only versus mutation operation. For a search tool that likely queries sensitive Salesforce data, this lack of behavioral context is a significant gap.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a single-parameter tool and front-loads the core functionality immediately. Every word earns its place in conveying the essential purpose.

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

Completeness2/5

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

Given no annotations, no output schema, and a sibling tool ('run_soql_query') that serves a similar purpose, the description is incomplete. It doesn't help the agent understand when to choose SOSL over SOQL, what the response contains, or any behavioral constraints. For a Salesforce search operation among multiple data access tools, this minimal description leaves critical gaps.

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 description coverage is 100% with a single well-documented parameter, so the baseline is 3. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain SOSL syntax rules, provide additional examples beyond the schema's example, or clarify what 'against Salesforce' means for parameter construction.

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 clearly states the action ('Executes') and target ('a SOSL search against Salesforce'), providing a specific verb+resource combination. It distinguishes this from general search operations by specifying SOSL (Salesforce Object Search Language), though it doesn't explicitly differentiate from the sibling 'run_soql_query' tool which handles SOQL queries instead.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when SOSL searches are appropriate compared to SOQL queries (via 'run_soql_query'), when to use REST API calls (via 'restful'), or any prerequisites or constraints for SOSL execution. The agent must infer usage from the tool name alone.

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/ampcome-mcps/salesforce-mcp'

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