Skip to main content
Glama

run_sosl_search

Execute SOSL searches to find records across multiple Salesforce objects and fields using structured queries.

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

  • Executes the SOSL search tool logic: extracts 'search' argument, performs sf_client.sf.search(), and returns JSON results as TextContent.
    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 handle_list_tools(): defines name, description, and inputSchema for 'run_sosl_search' requiring a 'search' string.
    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"],
        },
    ),

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

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