run_sosl_search
Execute SOSL searches on Salesforce to retrieve records matching specific criteria across all fields, enabling targeted data retrieval for analysis and processing.
Instructions
Executes a SOSL search against Salesforce
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | Yes | The SOSL search to execute (e.g., 'FIND {John Smith} IN ALL FIELDS') |
Implementation Reference
- src/salesforce/server.py:318-329 (handler)Executes the SOSL search tool: extracts 'search' argument, calls sf_client.sf.search(), formats 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)}", ) ]
- src/salesforce/server.py:110-123 (registration)Registers the 'run_sosl_search' tool in @server.list_tools() with description and inputSchema 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"], }, ),