update_record
Modify existing Salesforce records by providing object name, record ID, and updated data fields to maintain accurate information.
Instructions
Updates an existing record
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"object_name": "<object_name>",
"record_id": "<record_id>",
"data": "<data>"
},
"name": "update_record"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | The name of the Salesforce object (e.g., 'Account', 'Contact') | |
| record_id | Yes | The ID of the record to update | |
| data | Yes | The updated data for the record |
Implementation Reference
- src/salesforce/server.py:373-388 (handler)Handler implementation for the 'update_record' tool. Extracts object_name, record_id, and data from arguments, validates them, retrieves the Salesforce object dynamically, calls the update method on the record, and returns a TextContent with 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}", ) ] - src/salesforce/server.py:176-199 (schema)JSON Schema definition for the 'update_record' tool inputs, specifying required parameters: object_name, record_id, and data (object). Part of the tool registration in 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"], }, ), - src/salesforce/server.py:176-199 (registration)Registration of the 'update_record' tool within the @server.list_tools() decorator, including name, description, and input schema.
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"], }, ),