Skip to main content
Glama
ampcome-mcps

MCP Salesforce Connector

by ampcome-mcps

get_record

Retrieve specific Salesforce records by object name and ID to access customer data, account information, or other stored details within the CRM system.

Instructions

Retrieves a specific record by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYesThe name of the Salesforce object (e.g., 'Account', 'Contact')
record_idYesThe ID of the record to retrieve

Implementation Reference

  • Handler implementation for the 'get_record' tool: extracts object_name and record_id from arguments, retrieves the Salesforce object, fetches the record using simple-salesforce library, and returns the record data as JSON.
    elif name == "get_record":
        object_name = arguments.get("object_name")
        record_id = arguments.get("record_id")
        if not object_name or not record_id:
            raise ValueError("Missing 'object_name' or 'record_id' argument")
        if not sf_client.sf:
            raise ValueError("Salesforce connection not established.")
        sf_object = getattr(sf_client.sf, object_name)
        results = sf_object.get(record_id)
        return [
            types.TextContent(
                type="text",
                text=f"{object_name} Record (JSON):\n{json.dumps(results, indent=2)}",
            )
        ]
  • Tool registration for 'get_record' including name, description, and input schema definition within the @server.list_tools() handler.
    types.Tool(
        name="get_record",
        description="Retrieves a specific record by ID",
        inputSchema={
            "type": "object",
            "properties": {
                "object_name": {
                    "type": "string",
                    "description": "The name of the Salesforce object (e.g., 'Account', 'Contact')",
                },
                "record_id": {
                    "type": "string",
                    "description": "The ID of the record to retrieve",
                },
            },
            "required": ["object_name", "record_id"],
        },
    ),
  • JSON schema for 'get_record' tool input: requires object_name and record_id as strings.
    inputSchema={
        "type": "object",
        "properties": {
            "object_name": {
                "type": "string",
                "description": "The name of the Salesforce object (e.g., 'Account', 'Contact')",
            },
            "record_id": {
                "type": "string",
                "description": "The ID of the record to retrieve",
            },
        },
        "required": ["object_name", "record_id"],
    },

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