Skip to main content
Glama
ampcome-mcps

MCP Salesforce Connector

by ampcome-mcps

update_record

Modify existing Salesforce records by specifying the object type, record ID, and updated data fields to maintain current information in your CRM system.

Instructions

Updates an existing record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYesThe name of the Salesforce object (e.g., 'Account', 'Contact')
record_idYesThe ID of the record to update
dataYesThe updated data for the record

Implementation Reference

  • Handler for the 'update_record' tool: extracts object_name, record_id, data from arguments, performs the update via simple-salesforce library, and returns the result.
    elif name == "update_record":
        object_name = arguments.get("object_name")
        record_id = arguments.get("record_id")
        data = arguments.get("data")
        if not object_name or not record_id or not data:
            raise ValueError("Missing 'object_name', 'record_id', or 'data' argument")
        if not sf_client.sf:
            raise ValueError("Salesforce connection not established.")
        sf_object = getattr(sf_client.sf, object_name)
        results = sf_object.update(record_id, data)
        return [
            types.TextContent(
                type="text",
                text=f"Update {object_name} Record Result: {results}",
            )
        ]
  • Input JSON schema for the 'update_record' tool, defining required parameters: object_name (string), record_id (string), data (object). This is part of the tool registration in handle_list_tools().
    types.Tool(
        name="update_record",
        description="Updates an existing record",
        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 update",
                },
                "data": {
                    "type": "object",
                    "description": "The updated data for the record",
                    "properties": {},
                    "additionalProperties": True,
                },
            },
            "required": ["object_name", "record_id", "data"],
        },
    ),
  • The tool is registered by being included in the return value of the @server.list_tools() handler, which lists all available tools with their schemas.
    @server.list_tools()
    async def handle_list_tools() -> list[types.Tool]:
        """
        List available tools.
        Each tool specifies its arguments using JSON Schema validation.
        """
        return [
            types.Tool(
                name="run_soql_query",
                description="Executes a SOQL query against Salesforce",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string",
                            "description": "The SOQL query to execute",
                        },
                    },
                    "required": ["query"],
                },
            ),
            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"],
                },
            ),
            types.Tool(
                name="get_object_fields",
                description="Retrieves field Names, labels and types for a specific Salesforce object",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "object_name": {
                            "type": "string",
                            "description": "The name of the Salesforce object (e.g., 'Account', 'Contact')",
                        },
                    },
                    "required": ["object_name"],
                },
            ),
            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"],
                },
            ),
            types.Tool(
                name="create_record",
                description="Creates a new record",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "object_name": {
                            "type": "string",
                            "description": "The name of the Salesforce object (e.g., 'Account', 'Contact')",
                        },
                        "data": {
                            "type": "object",
                            "description": "The data for the new record",
                            "properties": {},
                            "additionalProperties": True,
                        },
                    },
                    "required": ["object_name", "data"],
                },
            ),
            types.Tool(
                name="update_record",
                description="Updates an existing record",
                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 update",
                        },
                        "data": {
                            "type": "object",
                            "description": "The updated data for the record",
                            "properties": {},
                            "additionalProperties": True,
                        },
                    },
                    "required": ["object_name", "record_id", "data"],
                },
            ),
            types.Tool(
                name="delete_record",
                description="Deletes a record",
                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 delete",
                        },
                    },
                    "required": ["object_name", "record_id"],
                },
            ),
            types.Tool(
                name="tooling_execute",
                description="Executes a Tooling API request",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "action": {
                            "type": "string",
                            "description": "The Tooling API endpoint to call (e.g., 'sobjects/ApexClass')",
                        },
                        "method": {
                            "type": "string",
                            "description": "The HTTP method (default: 'GET')",
                            "enum": ["GET", "POST", "PATCH", "DELETE"],
                            "default": "GET",
                        },
                        "data": {
                            "type": "object",
                            "description": "Data for POST/PATCH requests",
                            "properties": {},
                            "additionalProperties": True,
                        },
                    },
                    "required": ["action"],
                },
            ),
            types.Tool(
                name="apex_execute",
                description="Executes an Apex REST request",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "action": {
                            "type": "string",
                            "description": "The Apex REST endpoint to call (e.g., '/MyApexClass')",
                        },
                        "method": {
                            "type": "string",
                            "description": "The HTTP method (default: 'GET')",
                            "enum": ["GET", "POST", "PATCH", "DELETE"],
                            "default": "GET",
                        },
                        "data": {
                            "type": "object",
                            "description": "Data for POST/PATCH requests",
                            "properties": {},
                            "additionalProperties": True,
                        },
                    },
                    "required": ["action"],
                },
            ),
            types.Tool(
                name="restful",
                description="Makes a direct REST API call to Salesforce",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "path": {
                            "type": "string",
                            "description": "The path of the REST API endpoint (e.g., 'sobjects/Account/describe')",
                        },
                        "method": {
                            "type": "string",
                            "description": "The HTTP method (default: 'GET')",
                            "enum": ["GET", "POST", "PATCH", "DELETE"],
                            "default": "GET",
                        },
                        "params": {
                            "type": "object",
                            "description": "Query parameters for the request",
                            "properties": {},
                            "additionalProperties": True,
                        },
                        "data": {
                            "type": "object",
                            "description": "Data for POST/PATCH requests",
                            "properties": {},
                            "additionalProperties": True,
                        },
                    },
                    "required": ["path"],
                },
            ),
        ]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Updates an existing record' implies a mutation operation, but it doesn't disclose critical traits like required permissions, whether updates are reversible, error handling for invalid IDs, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise with just three words: 'Updates an existing record'. It's front-loaded and wastes no space, making it efficient for an agent to parse. However, this conciseness comes at the cost of completeness in other dimensions.

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 the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success or failure, return values, or system-specific behaviors (e.g., Salesforce validation rules). For a tool that modifies data, more context is needed to ensure safe and effective use.

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 clear descriptions for all three parameters (object_name, record_id, data). The description adds no additional meaning beyond what the schema provides, such as examples or constraints. Given the high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Updates an existing record' states the basic action (update) and resource (record), but it's vague about what kind of record system this operates on (Salesforce) and doesn't distinguish it from sibling tools like 'create_record' or 'delete_record' beyond the verb. It's minimally adequate but lacks specificity.

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 prerequisites (e.g., needing an existing record ID), exclusions, or comparisons to siblings like 'create_record' for new records or 'get_record' for retrieval. This leaves the agent with no contextual usage information.

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