Skip to main content
Glama
smn2gnt

MCP Salesforce Connector

by smn2gnt

update_record

Modify existing Salesforce records by specifying the object name, record ID, and updated data. Integrates with the MCP Salesforce Connector for efficient record management.

Instructions

Updates an existing record

Input Schema

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

Implementation Reference

  • Handler for the 'update_record' tool: extracts object_name, record_id, and data from arguments, validates them and the Salesforce connection, then performs the update using simple-salesforce's sf_object.update method.
    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}", ) ]
  • Registration of the 'update_record' tool in the list_tools decorator, including its description and JSON schema for input validation (object_name, record_id, 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"], }, ),
  • Input schema definition for the 'update_record' tool, specifying required fields: object_name (string), record_id (string), and data (object).
    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"], },

Other Tools

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

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