Skip to main content
Glama

Salesforce MCP Server

salesforce_write_apex

Generate or modify Apex classes in Salesforce by specifying class name, API version, and code body. Use 'create' to build new classes or 'update' to revise existing ones.

Instructions

Create or update Apex classes in Salesforce.

Examples:

  1. Create a new Apex class: { "operation": "create", "className": "AccountService", "apiVersion": "58.0", "body": "public class AccountService { public static void updateAccounts() { /* implementation */ } }" }
  2. Update an existing Apex class: { "operation": "update", "className": "AccountService", "body": "public class AccountService { public static void updateAccounts() { /* updated implementation */ } }" }

Notes:

  • The operation must be either 'create' or 'update'
  • For 'create' operations, className and body are required
  • For 'update' operations, className and body are required
  • apiVersion is optional for 'create' (defaults to the latest version)
  • The body must be valid Apex code
  • The className in the body must match the className parameter
  • Status information is returned after successful operations

Input Schema

NameRequiredDescriptionDefault
apiVersionNoAPI version for the Apex class (e.g., '58.0')
bodyYesFull body of the Apex class
classNameYesName of the Apex class to create or update
operationYesWhether to create a new class or update an existing one

Input Schema (JSON Schema)

{ "properties": { "apiVersion": { "description": "API version for the Apex class (e.g., '58.0')", "type": "string" }, "body": { "description": "Full body of the Apex class", "type": "string" }, "className": { "description": "Name of the Apex class to create or update", "type": "string" }, "operation": { "description": "Whether to create a new class or update an existing one", "enum": [ "create", "update" ], "type": "string" } }, "required": [ "operation", "className", "body" ], "type": "object" }

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/tsmztech/mcp-server-salesforce'

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