# io.github.semwalajay83-sem/salesforce-metadata-mcp (npm · salesforce-metadata-mcp)

The only Salesforce MCP with Agentforce, OmniStudio & DevOps Center tools — 222 total.

- Trust score: 65/100 (medium)
- Change this week: +22
- Registry status: active
- Liveness: live
- Owner verified: no
- Last scored: 2026-08-03

## Components

- npm · `salesforce-metadata-mcp`: 65/100 (this document), [markdown](https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp.md), [page](https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp)

## Channel facts

- Registry: `npm`
- Package: `salesforce-metadata-mcp`
- Version: `2.8.7`
- Transport: `stdio`

## Trust breakdown

How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. Scores are 0–100 per category. Scoring method: https://verifymcp.io/docs/scoring (what has changed: https://verifymcp.io/docs/scoring/changelog)

Scored 2026-08-03.

- **Supply Chain Security**: 83/100
  - No malware found by supply-chain analysis.
  - CVE check failed: a known medium-severity CVE affects @hono/node-server 1.19.17, reached via @modelcontextprotocol/sdk > @hono/node-server. A fixed version is available.
  - No install/post-install scripts declared.
  - Only part of the dependency tree could be resolved (107 of 111), so this covers what we could see, not the whole tree.
- **Provenance & Transparency**: 45/100
  - Source repository is publicly reachable at the declared URL.
  - Provenance check failed: no build-provenance attestation is published.
  - Clear OSI-approved license (MIT).
  - Actively maintained (last published 2 days ago).
  - Disclosure check failed: no security disclosure policy was found in the source repository.
- **Schema Quality & AI Usability**: 65/100
  - AI-judged instruction clarity (excellent).
  - Context-footprint check failed: tool/resource definitions use about 38003 tokens (~171/item across 222 items; 222 tools + 0 resources), over budget; trim descriptions and params.
  - Usage-examples check failed: none of the tools include examples.
- **Stability & Change Management**: 23/100
  - Stability check failed: the tool surface changed between 2.7.0 and 2.8.7: 0 tool removals, 1 breaking changes, 3 additions.
- **Tool Coverage**: 98/100
  - 100% of tools have a non-trivial description (not blank, and not just the tool's name).
  - 94% of tool parameters carry a description.
- **Capabilities**: 100/100
  - Implements a supported MCP spec version (2025-11-25); the latest is 2026-07-28.

## Install

### Claude

```bash
claude mcp add semwalajay83-sem-salesforce-metadata-mcp -- npx -y salesforce-metadata-mcp
```

### Codex

```bash
codex mcp add semwalajay83-sem-salesforce-metadata-mcp -- npx -y salesforce-metadata-mcp
```

### opencode

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "semwalajay83-sem-salesforce-metadata-mcp": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "salesforce-metadata-mcp"
      ],
      "enabled": true
    }
  }
}
```

### OpenClaw

```bash
openclaw mcp add semwalajay83-sem-salesforce-metadata-mcp --command npx --arg -y --arg salesforce-metadata-mcp
```

### Hermes

```yaml
mcp_servers:
  semwalajay83-sem-salesforce-metadata-mcp:
    command: "npx"
    args: ["-y", "salesforce-metadata-mcp"]
```

### Other

```json
{
  "mcpServers": {
    "semwalajay83-sem-salesforce-metadata-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "salesforce-metadata-mcp"
      ]
    }
  }
}
```

## Changelog

Every change recorded for this component, newest first. Days that predate change tracking, or that we cannot explain, say so: "we were watching and nothing happened" and "we were not watching" are different claims.

### 2026-08-02 (score 65, +39)

- [security regression] Known CVEs: unverified → fail
- [security regression] Stability: unverified → fail
- [security improvement] Malware scan: unverified → pass
- [functional improvement] Schema quality: unverified → excellent
- [functional improvement] MCP protocol: unverified → pass
- [functional improvement] Dependency health: unverified → partial

### 2026-08-01 (score 26, −9)

- [security regression] Known CVEs: fail → unverified
- [functional regression] Dependency health: partial → unverified

### 2026-07-31 (score 35, +20)

- [functional] We updated how we score, so this day's move reflects our rubric, not a change to the server

### 2026-07-30 (score 15, +7)

- [security regression] Provenance: unverified → fail
- [security improvement] Install scripts: unverified → pass
- [functional regression] Security disclosure: unverified → fail
- [functional regression] Dependency health: partial → unverified
- [functional improvement] Maintenance: unverified → pass
- [functional improvement] License: unverified → pass
- [functional] Licence: MIT

### 2026-07-29 (score 8, −16)

- [security regression] Malware scan: pass → unverified
- [functional regression] Security disclosure: fail → unverified
- [functional improvement] Dependency health: unverified → partial
- [functional] Package version: 2.7.0 → 2.8.0

### 2026-07-28 (score 24, −19)

- [functional regression] Tool coverage: 100 → unverified
- [functional] First check of Schema quality: unverified

### 2026-07-27 (score 43)

First indexed and scored.

## MCP tools (222)

### `sf_create_custom_object` (~288 tokens)

Create Salesforce Custom Object

Creates a new Salesforce Custom Object using the Metadata API. The object name must end with '__c'. Use this when a user asks to create a new object, entity, or table in Salesforce.

Input parameters:

- `autoNumberFormat` (string): Format for AutoNumber name field, e.g. 'INV-{0000}'. Required when nameFieldType is AutoNumber.
- `deploymentStatus` (string): Deployment status of the object
- `description` (string): Optional description for the object
- `enableActivities` (boolean): Allow activities (tasks/events) on this object
- `enableHistory` (boolean): Enable field history tracking
- `enableReports` (boolean): Make the object available for reports
- `enableSearch` (boolean): Enable search on this object
- `fullName` (string, required): API name of the custom object, e.g. 'Invoice__c'
- `label` (string, required): Singular label shown in the UI, e.g. 'Invoice'
- `nameFieldLabel` (string): Label for the standard Name field, e.g. 'Invoice Name'
- `nameFieldType` (string): Type of Name field: 'Text' (free-form) or 'AutoNumber' (auto-increment)
- `pluralLabel` (string, required): Plural label, e.g. 'Invoices'
- `sharingModel` (string): OWD sharing model for the object

### `sf_create_custom_field` (~431 tokens)

Create Salesforce Custom Field

Creates a new custom field on an existing Salesforce object. The field API name must end with '__c'. Supports all field types: Text, Number, Picklist, Lookup, etc.

Input parameters:

- `defaultValue` (boolean|string): Default value for the field. Use true/false for Checkbox fields.
- `deleteConstraint` (string): Delete behaviour for Lookup fields: 'Cascade', 'Restrict', or 'SetNull'
- `description` (string): Optional description for the field
- `externalId` (boolean): Whether this field is an external ID
- `fieldName` (string, required): API name of the field, e.g. 'Status__c'
- `label` (string, required): Display label for the field, e.g. 'Status'
- `length` (integer): Max length. Text/TextArea: 1–255 (default 255). LongTextArea/Html (Text Area Long / Rich Text Area): 256–131072 (default 32768).
- `objectName` (string, required): API name of the parent object, e.g. 'Account' or 'Invoice__c'
- `picklistValues` (object): Picklist configuration. Required for Picklist / MultiselectPicklist types.
- `precision` (integer): Total digits for Number/Currency/Percent (1–18)
- `referenceTo` (string): Target object API name for Lookup/MasterDetail, e.g. 'Account'
- `relationshipLabel` (string): Label for the relationship on the related object
- `relationshipName` (string): API name for the relationship (no spaces)
- `required` (boolean): Whether the field is required on page layouts
- `scale` (integer): Decimal places for Number/Currency/Percent (0–17)
- `type` (string, required): Salesforce field type
- `unique` (boolean): Whether values must be unique (Text, Number, Email)
- `visibleLines` (integer): Visible lines. Required for LongTextArea and Html (Text Area Long / Rich Text Area) — default 10. Also used for MultiselectPicklist.

### `sf_add_picklist_values` (~92 tokens)

Add Picklist Values to Existing Field

Adds new picklist values to an existing Picklist or MultiselectPicklist field without removing existing values. Use when a user wants to add new options to a dropdown.

Input parameters:

- `objectFieldFullName` (string, required): Full API name of the picklist field, e.g. 'Invoice__c.Status__c'
- `values` (array, required): New picklist values to add (existing values are preserved)

### `sf_create_flow` (~743 tokens)

Create Salesforce Flow

Creates or updates a Salesforce Flow via the Metadata API. Supports AutoLaunchedFlow (required for Agentforce actions), Screen Flow, RecordTriggeredFlow, and ScheduledFlow. Supports advanced elements: Decision, GetRecords, CreateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen via the 'elements' array. GetRecords filter operators supported: EqualTo, NotEqualTo, GreaterThan, LessThan, GreaterThanOrEqualTo, LessThanOrEqualTo, IsNull, StartsWith, EndsWith. Contains is NOT supported by Salesforce Flow record lookups and will return an error. IMPORTANT for Agentforce: set flowType to 'AutoLaunchedFlow' and status to 'Active' — Draft flows and Screen flows cannot be invoked by agents.

Input parameters:

- `apiName` (string, required): API name for the flow, e.g. 'New_Lead_Onboarding'
- `constants` (array): Constant resources — fixed values that never change during the flow run.
- `description` (string): Description of what this flow does
- `elements` (array): Advanced flow elements: Decision, GetRecords, CreateRecords, UpdateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen. (Wait and PlatformEvent are not supported — t…
- `fieldUpdates` (array): Simple field updates on the triggering record (for RecordTriggeredFlow)
- `flowType` (string): Flow type: 'AutoLaunchedFlow' (required for Agentforce actions — agents can ONLY invoke AutoLaunchedFlow, not Screen flows), 'Flow' (Screen flow for guided UI), 'RecordTriggeredFlow' (fires on record…
- `formulas` (array): Formula resources — recalculated every time they are referenced. Use for derived values instead of an Assignment when the value should always reflect current data.
- `label` (string, required): Human-readable flow label, e.g. 'New Lead Onboarding'
- `recordTriggerType` (string): Which record changes fire the flow: 'Create' (new records only), 'Update' (edits only), 'CreateAndUpdate' (default), 'Delete'. Ignored for RecordBeforeDelete, which is already delete-only.
- `scheduleFrequency` (string): How often a ScheduledFlow runs. Defaults to Daily.
- `scheduleStartDate` (string): Date a ScheduledFlow starts running, YYYY-MM-DD. Defaults to today.
- `scheduleStartTime` (string): Time of day a ScheduledFlow runs, e.g. '13:00:00.000Z'. Defaults to midnight UTC.
- `status` (string): Flow activation status. IMPORTANT: Agentforce agents can ONLY invoke Active flows — Draft flows are invisible to agents and will cause silent failures. Set to 'Active' when creating flows for agent a…
- `submitForApprovalProcessName` (string): API name of the Approval Process to automatically submit the record into. Works with any approval process — just pass its API name.
- `textTemplates` (array): Text template resources — reusable text blocks with merge fields, typically for email bodies.
- `triggerFilterFormula` (string): Formula to filter which records trigger the flow, e.g. "ISPICKVAL(StageName,'Closed Won')"
- `triggerObject` (string): Object API name for record-triggered flows, e.g. 'Opportunity'
- `triggerType` (string): When to trigger: RecordBeforeSave, RecordAfterSave, RecordBeforeDelete
- `variables` (array): Input/output variables

### `sf_create_approval_process` (~301 tokens)

Create Salesforce Approval Process

Creates or updates a Salesforce Approval Process via the Metadata API. Define who can submit, approval steps with approvers, entry criteria, and what happens on approval or rejection.

Input parameters:

- `active` (boolean): Activate immediately (warning: cannot change steps after activation)
- `allowRecall` (boolean): Allow submitters to recall approval requests
- `allowedSubmitters` (array, required): Who can submit: [{type:'owner'}] or [{type:'role', submitter:'SalesRep'}]
- `approvalSteps` (array, required): Ordered list of approval steps
- `description` (string): Description of the approval process
- `emailTemplate` (string): Email template for approval notifications, e.g. 'unfiled$public/ApprovalEmail'
- `entryFilterCriteria` (array): Filter criteria alternative to entryFormula
- `entryFormula` (string): Formula records must satisfy to enter this process
- `finalApprovalLock` (boolean): Lock record after final approval
- `finalRejectionLock` (boolean): Lock record after final rejection
- `label` (string, required): Human-readable label, e.g. 'Large Deal Approval Process'
- `objectName` (string, required): Object API name, e.g. 'Opportunity' or 'Leave_Request__c'
- `processName` (string, required): API name of the process, e.g. 'Large_Deal_Approval'
- `recordEditability` (string): Who can edit locked records during approval

### `sf_create_validation_rule` (~201 tokens)

Create Salesforce Validation Rule

Creates or updates a Salesforce Validation Rule on any object via the Metadata API. The errorConditionFormula returns TRUE when data is INVALID. Use for data quality enforcement.

Input parameters:

- `active` (boolean): Whether the rule is active
- `description` (string): Description of this validation rule
- `errorConditionFormula` (string, required): Formula returning TRUE when data is INVALID, e.g. "AND(ISPICKVAL(StageName,'Closed Won'),ISBLANK(CloseDate))"
- `errorDisplayField` (string): Field API name to display error next to, e.g. 'CloseDate'. Blank = top of page.
- `errorMessage` (string, required): Error shown to user when validation fails (max 255 chars)
- `objectName` (string, required): Object API name, e.g. 'Account', 'Opportunity', 'Invoice__c'
- `ruleName` (string, required): API name for the rule, e.g. 'Require_Close_Date'

### `sf_create_workflow_field_update` (~185 tokens)

Create Salesforce Workflow Field Update Action

Creates a Workflow Field Update action that can be referenced by Approval Processes, Workflow Rules, or Flows. Sets a field to a literal value, formula result, or null.

Input parameters:

- `actionName` (string, required): API name of the action, e.g. 'Set_Stage_Closed_Won'
- `field` (string, required): Field API name to update, e.g. 'StageName'
- `formula` (string): Formula for the new value, e.g. 'TODAY()'
- `label` (string, required): Human-readable label
- `literalValue` (string): Literal string/picklist value to set
- `notifyAssignee` (boolean): Notify owner/assignee after update
- `nullValue` (boolean): Set the field to null/blank
- `objectName` (string, required): Object API name, e.g. 'Opportunity'

### `sf_create_formula_field` (~399 tokens)

Create Formula Field

Creates a formula field on any Salesforce object. Supports all return types (Text, Number, Currency, Date, DateTime, Checkbox, Percent) and the full Salesforce formula language: IF/AND/OR/NOT, BLANKVALUE, TEXT, VALUE, DATE, DATEVALUE, TODAY, NOW, date functions (MONTH/YEAR/DAY), math (FLOOR/CEILING/MOD), string functions (LEN/LEFT/RIGHT/MID/TRIM/UPPER/LOWER/CONTAINS/BEGINS), record type and picklist functions (ISPICKVAL, ISNULL, ISBLANK), cross-object field references (e.g. Account.Owner.Name), and VLOOKUP. Complex multi-line formulas are fully supported.

Input parameters:

- `description` (string): Field description
- `fieldName` (string, required): Field name without __c suffix
- `formula` (string, required): Salesforce formula expression. Supports all Salesforce formula functions: IF, AND, OR, NOT, BLANKVALUE, TEXT, VALUE, DATE, DATEVALUE, TODAY, NOW, MONTH, YEAR, DAY, FLOOR, CEILING, MOD, LEN, LEFT, RIG…
- `formulaTreatBlanksAs` (string): How to treat blank fields in the formula. Defaults to BlankAsZero for numeric types, BlankAsLogicalFalse for Checkbox.
- `label` (string, required): Field label
- `objectApiName` (string, required): Object API name, e.g. 'Opportunity'
- `precision` (integer): Total number of digits for Number/Currency/Percent return types (default 18)
- `returnType` (string, required): Formula return type
- `scale` (integer): Decimal places for Number/Currency/Percent return types

### `sf_create_custom_metadata_type` (~138 tokens)

Create Custom Metadata Type

Creates a new Custom Metadata Type (ending in __mdt) with optional custom fields. Custom Metadata Types store configuration data that can be packaged and deployed. Use when a user wants to store configuration in metadata rather than custom objects.

Input parameters:

- `description` (string): Description of the type
- `fields` (array): Custom fields to add to this type
- `fullName` (string, required): API name of the Custom Metadata Type, e.g. 'Config__mdt'
- `label` (string, required): Singular label, e.g. 'Config'
- `pluralLabel` (string, required): Plural label, e.g. 'Configs'

### `sf_create_custom_metadata_record` (~125 tokens)

Create Custom Metadata Record

Creates a record within an existing Custom Metadata Type (__mdt). Custom metadata records store configuration values that can be read in Apex, Flows, and formulas. Provide typeName (e.g., 'Config__mdt'), a record name, and field values.

Input parameters:

- `label` (string, required): Record label
- `recordName` (string, required): Record developer name, e.g. 'Default_Config'
- `typeName` (string, required): Custom Metadata Type API name, e.g. 'Config__mdt'
- `values` (array, required): Field values for this record

### `sf_create_custom_label` (~153 tokens)

Create or Update Custom Label

Creates or updates a Salesforce Custom Label. Custom Labels are text values accessible in Apex, Visualforce, LWC, and Flows, with support for translation. Use for internationalizable text strings, error messages, or UI labels.

Input parameters:

- `categories` (string): Category for grouping labels
- `fullName` (string, required): API name of the label, e.g. 'Welcome_Message'
- `language` (string): Language code, e.g. 'en_US', 'fr', 'de'
- `protected` (boolean): Protected labels are only accessible by the package that created them
- `shortDescription` (string): Short description of the label's purpose
- `value` (string, required): The label text value

### `sf_create_custom_setting` (~171 tokens)

Create Custom Setting

Creates a Custom Setting object (ending in __c) with Hierarchy or List type. Custom Settings store data accessible via Apex without SOQL queries. Hierarchy type supports org/profile/user level overrides. Use for feature flags, thresholds, or configurable constants.

Input parameters:

- `description` (string): Description of this custom setting
- `fields` (array): Custom fields to add to this setting
- `fullName` (string, required): API name of the custom setting, e.g. 'OrgPreferences__c'
- `label` (string, required): Label for the custom setting object
- `settingType` (string): Hierarchy: overridable at org/profile/user level. List: simple key-value list.
- `visibility` (string): Public: accessible to all Apex/VF. Protected: only accessible within the namespace.

### `sf_create_global_value_set` (~167 tokens)

Create Global Value Set (Shared Picklist)

Creates a Global Value Set — a shared picklist definition that can be referenced by multiple Picklist fields across different objects. Any change to the Global Value Set is reflected in all fields that use it. Use when the same set of values (like Status, Priority, Region) should be shared and kept in sync across multiple objects. fullName must end with __gvs, e.g. 'Industry_Types__gvs'.

Input parameters:

- `description` (string): Description
- `fullName` (string, required): API name of the global value set, e.g. 'Industry_Types__gvs'
- `masterLabel` (string, required): Label for the global value set
- `sorted` (boolean): Auto-sort values alphabetically
- `values` (array, required): Picklist values

### `sf_create_record_type` (~179 tokens)

Create Record Type

Creates a Record Type on a Salesforce object. Record Types allow different page layouts, picklist values, and business processes for different types of records on the same object. For example, create 'Enterprise' and 'SMB' record types on Opportunity with different Stage values.

Input parameters:

- `businessProcess` (string): Business process API name to associate (for Opportunity/Lead/Case/Solution)
- `description` (string): Description
- `fullName` (string, required): Record type developer name, e.g. 'Enterprise_Deal'
- `isActive` (boolean): Whether this record type is active
- `label` (string, required): Record type label
- `objectName` (string, required): Object API name, e.g. 'Opportunity' or 'Case__c'
- `picklistValues` (array): Restrict picklist values per record type

### `sf_create_business_process` (~132 tokens)

Create Business Process

Creates a Business Process for Opportunity (Stage values), Lead (Status values), Case (Status values), or Solution (Status values). Business Processes define which picklist values are available for a given Record Type. Must be created before assigning to a Record Type.

Input parameters:

- `description` (string): Description
- `isActive` (boolean): Whether this process is active
- `label` (string, required): Display label
- `objectName` (string, required): Object the business process applies to
- `processName` (string, required): Business process developer name
- `values` (array, required): Stage/status values included in this business process

### `sf_create_page_layout` (~138 tokens)

Create Page Layout

Creates a Page Layout for a Salesforce object. Page Layouts control what fields, related lists, and buttons appear on record detail and edit pages. Layouts are assigned to user profiles and record types. Define sections with fields and the related lists to include.

Input parameters:

- `label` (string, required): Layout display label
- `layoutName` (string, required): Layout developer name, e.g. 'Account_Layout'
- `objectName` (string, required): Object API name, e.g. 'Account' or 'Case__c'
- `relatedLists` (array): Related list API names to include
- `sections` (array): Layout sections with fields

### `sf_create_sharing_rule` (~186 tokens)

Create Sharing Rule

Creates a Sharing Rule for a Salesforce object. Sharing Rules extend the OWD by automatically sharing records with users who meet criteria (criteria-based) or who own records (ownership-based). Use to give specific roles/groups access to records they wouldn't normally see based on OWD.

Input parameters:

- `accessLevel` (string): Access level granted
- `criteriaItems` (array): For criteria-based rules: conditions that trigger sharing
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Account', 'Opportunity'
- `ruleName` (string, required): Sharing rule developer name
- `ruleType` (string): criteria: share based on field values. ownership: share based on record owner.
- `sharedFrom` (object): For ownership-based rules: whose records are shared
- `sharedTo` (object, required): Who receives the sharing

### `sf_create_field_dependency` (~114 tokens)

Create Field Dependency (Controlling/Dependent Picklist)

Creates a field dependency between a controlling picklist and a dependent picklist on the same object. When a user selects a value in the controlling field, only the relevant dependent field values appear. Example: when Country = 'USA', State shows only US states.

Input parameters:

- `controllingField` (string, required): Controlling picklist field API name
- `dependentField` (string, required): Dependent picklist field API name
- `objectName` (string, required): Object API name
- `valueSettings` (array, required): Value dependency mappings

### `sf_create_email_alert` (~215 tokens)

Create Workflow Email Alert

Creates a Workflow Email Alert action that can be triggered by Flows, Approval Processes, or Workflow Rules. Specify the email template to use and recipients (owner, creator, users, roles, or custom email addresses). Use when you need to send notification emails as part of automation.

Input parameters:

- `alertName` (string, required): API name of the email alert, e.g. 'Notify_Owner_On_Close'
- `description` (string): Description
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Opportunity', 'Case'
- `protected` (boolean): Protected email alert
- `recipients` (array, required): Who receives the email
- `senderAddress` (string): Org-wide email address (required if senderType is OrgWideEmailAddress)
- `senderType` (string): Who the email appears to come from
- `template` (string, required): Email template full name, e.g. 'unfiled$public/MyTemplate' or 'MyFolder/MyTemplate'

### `sf_create_platform_event` (~164 tokens)

Create Platform Event

Creates a Platform Event object (ending in __e) for event-driven architecture. Platform Events enable real-time publish/subscribe communication between systems. Publishers fire events and subscribers (Flows, Apex triggers, external systems) react to them. PublishAfterCommit waits for DML to commit; PublishImmediately fires right away.

Input parameters:

- `description` (string): Description of the event
- `fields` (array): Custom fields on the platform event
- `fullName` (string, required): Platform event API name, e.g. 'Order_Created__e'
- `label` (string, required): Singular label
- `pluralLabel` (string, required): Plural label
- `publishBehavior` (string): PublishAfterCommit: published when DML transaction commits. PublishImmediately: published regardless of transaction.

### `sf_create_assignment_rule` (~126 tokens)

Create Lead or Case Assignment Rule

Creates an Assignment Rule for Leads or Cases. Assignment rules automatically route new records to the appropriate owner (user or queue) based on matching criteria. Only one rule can be active at a time per object. Rule entries are evaluated top-to-bottom and the first match wins.

Input parameters:

- `active` (boolean): Set as the active assignment rule
- `label` (string, required): Display label
- `objectName` (string, required): Object to apply assignment rules to
- `ruleEntries` (array, required): Ordered list of assignment rule entries
- `ruleName` (string, required): Assignment rule developer name

### `sf_create_escalation_rule` (~113 tokens)

Create Case Escalation Rule

Creates an Escalation Rule for Cases. Escalation rules automatically escalate cases that haven't been closed within a specified time, reassigning them to other users or queues and optionally sending notifications. Based on business hours and a configurable start date (creation time or last modification).

Input parameters:

- `active` (boolean): Set as the active escalation rule
- `label` (string, required): Display label
- `ruleEntries` (array, required): Rule entries
- `ruleName` (string, required): Escalation rule developer name

### `sf_create_auto_response_rule` (~122 tokens)

Create Auto-Response Rule

Creates an Auto-Response Rule for Web-to-Lead or Web-to-Case. When a lead or case is created via a web form, this rule automatically sends a confirmation email using the specified template. Rule entries define which template to use based on criteria.

Input parameters:

- `active` (boolean): Set as the active auto-response rule
- `label` (string, required): Display label
- `objectName` (string, required): Object for auto-response rules
- `ruleEntries` (array, required): Rule entries
- `ruleName` (string, required): Auto-response rule developer name

### `sf_create_matching_rule` (~132 tokens)

Create Matching Rule

Creates a Matching Rule used by Duplicate Rules to detect potential duplicate records. Define which fields to match on and which matching algorithm to use (Exact, FirstName, LastName, Company, Email, Phone, etc.). Must be created before creating a Duplicate Rule that references it.

Input parameters:

- `description` (string): Description
- `label` (string, required): Display label
- `matchingRuleItems` (array, required): Fields and methods used for matching
- `objectName` (string, required): Object API name, e.g. 'Lead', 'Contact', 'Account'
- `ruleName` (string, required): Matching rule developer name

### `sf_create_duplicate_rule` (~190 tokens)

Create Duplicate Rule

Creates a Duplicate Rule that uses Matching Rules to detect potential duplicates when records are saved. Can block duplicates, allow with a warning, or allow silently. Works for Leads, Contacts, Accounts, and custom objects. Requires existing Matching Rules.

Input parameters:

- `actionOnInsert` (string): What to do when a duplicate is found on insert
- `actionOnUpdate` (string): What to do when a duplicate is found on update
- `alertMessage` (string): Custom message shown when duplicate is detected
- `description` (string): Description
- `isActive` (boolean): Whether this rule is active
- `label` (string, required): Display label
- `matchingRules` (array, required): Matching rules to use for duplicate detection
- `objectName` (string, required): Object API name, e.g. 'Lead', 'Contact', 'Account'
- `ruleName` (string, required): Duplicate rule developer name

### `sf_create_apex_email_service` (~221 tokens)

Create Apex Email Service

Creates an Apex Email Service that processes inbound emails via an Apex class implementing Messaging.InboundEmailHandler. Useful for creating support cases from emails, parsing email content, or triggering workflows from inbound messages. The Apex class must exist before creating the service.

Input parameters:

- `apexClassName` (string, required): Apex class that implements Messaging.InboundEmailHandler
- `attachmentOption` (string): Which attachment types to process
- `authenticationFailureAction` (string): What to do on authentication failure
- `errorRoutingAddress` (string): Error routing email address
- `functionExceptionAction` (string): What to do when an exception occurs
- `functionInactiveAction` (string): What to do when function is inactive
- `functionName` (string, required): Email service function name
- `isActive` (boolean): Whether this email service is active
- `isAuthenticationRequired` (boolean): Require sender authentication
- `isErrorRoutingEnabled` (boolean): Route errors to an address
- `overLimitAction` (string): What to do when over API limits

### `sf_create_scheduled_job` (~138 tokens)

Create Scheduled Apex Job

Schedules an Apex class that implements the Schedulable interface to run on a cron schedule. Use for batch processing, nightly data cleanup, report generation, or any periodic automation. The Apex class must already exist in the org. Example cron: '0 0 2 * * ?' = daily at 2 AM.

Input parameters:

- `className` (string, required): Apex class that implements Schedulable interface
- `cronExpression` (string, required): Cron expression, e.g. '0 0 2 * * ?' for daily at 2 AM
- `jobName` (string, required): Name for the scheduled job

### `sf_create_scheduled_flow` (~173 tokens)

Create Schedule-Triggered Flow

Creates a Schedule-Triggered Flow that runs automatically on a recurring schedule (e.g., daily, weekly) against a batch of matching records. Use for nightly batch processing, periodic data updates, or scheduled notifications.

fullName: Flow API name
label: Flow display label
objectApiName: object whose records to process
scheduledPaths: array defining when the flow runs (offsetNumber, offsetUnit, timeSource)
description: optional description

Input parameters:

- `description` (string): Flow description
- `fullName` (string, required): Flow API name, e.g. 'Nightly_Account_Update'
- `label` (string, required): Flow display label
- `objectApiName` (string, required): Object API name to process records from, e.g. 'Account'
- `scheduledPaths` (array, required): Scheduled path definitions

### `sf_create_platform_event_trigger` (~168 tokens)

Create Platform Event Apex Trigger

Creates an Apex trigger that fires when a Platform Event message is received (after insert). Use to process incoming platform events with Apex logic — e.g., creating records, sending notifications, or calling external APIs when an event is published.

triggerName: Apex trigger name
eventApiName: Platform event API name, e.g. 'MyEvent__e'
body: Apex code body for the trigger
apiVersion: Salesforce API version

Input parameters:

- `apiVersion` (string): API version, e.g. '62.0'
- `body` (string, required): Apex trigger body code
- `eventApiName` (string, required): Platform event API name, e.g. 'MyEvent__e'
- `triggerName` (string, required): Apex trigger name, e.g. 'HandleMyEvent'

### `sf_create_workflow_rule` (~229 tokens)

Create Workflow Rule

Creates a Workflow Rule (legacy automation) that evaluates criteria and triggers actions. Use for simple automations that don't require the power of Flows. Supports formula or criteria-based evaluation. Workflow rules can trigger field updates, email alerts, outbound messages, and tasks.

objectName: object the rule applies to
fullName: rule developer name
triggerType: when to evaluate (onCreateOnly, onCreateOrTriggeringUpdate, onAllChanges)
active: whether the rule is active
formula or criteriaItems: define when the rule fires

Input parameters:

- `active` (boolean): Whether the rule is active
- `criteriaItems` (array): Filter criteria items (alternative to formula)
- `description` (string): Rule description
- `formula` (string): Formula criteria, e.g. 'ISPICKVAL(Status, "New")'
- `fullName` (string, required): Workflow rule developer name, e.g. 'Lead_Assign_Rule'
- `objectName` (string, required): Object API name, e.g. 'Lead'
- `triggerType` (string, required): When the rule evaluates

### `sf_create_field_update` (~225 tokens)

Create Workflow Field Update Action

Creates a standalone Workflow Field Update action that sets a field to a formula, literal value, or null when triggered. Can be associated with Workflow Rules, Approval Process steps, or used independently.

objectName: object the field update applies to
fullName: developer name of the field update
name: display name
field: field API name to update
operation: Formula, Literal, LiteralBlank, or Null
formula: Apex formula (for Formula operation)
literalValue: static value to set (for Literal operation)

Input parameters:

- `description` (string): Description
- `field` (string, required): Field API name to update, e.g. 'StageName'
- `formula` (string): Formula expression (when operation=Formula)
- `fullName` (string, required): Field update developer name
- `literalValue` (string): Literal value to set (when operation=Literal)
- `name` (string, required): Display name for the field update
- `objectName` (string, required): Object API name, e.g. 'Opportunity'
- `operation` (string, required): Type of update operation

### `sf_create_outbound_message` (~196 tokens)

Create Workflow Outbound Message

Creates a Workflow Outbound Message that sends a SOAP XML payload to an external endpoint when triggered by a Workflow Rule or Approval Process. Use for real-time integration with external systems that need to be notified of record changes.

objectName: object the message is for
fullName: developer name for the outbound message
name: display name
endpointUrl: external SOAP endpoint URL
fields: field API names to include in the message
integrationUser: optional username to authenticate the callout

Input parameters:

- `description` (string): Description
- `endpointUrl` (string, required): SOAP endpoint URL
- `fields` (array, required): Field API names to include in the message
- `fullName` (string, required): Outbound message developer name
- `integrationUser` (string): Username of the integration user (optional)
- `name` (string, required): Display name
- `objectName` (string, required): Object API name, e.g. 'Opportunity'

### `sf_create_permission_set` (~173 tokens)

Create Permission Set

Creates a Permission Set with object permissions, field permissions, Apex class access, and user permissions. Permission Sets extend a user's access without changing their profile. Use when you need to grant specific permissions to a subset of users (e.g., a 'Sales Manager' permission set that allows deleting opportunities).

Input parameters:

- `apexClassAccesses` (array): Apex class access permissions
- `description` (string): Description of this permission set
- `fieldPermissions` (array): Field-level permissions to grant
- `fullName` (string, required): Permission set API name, e.g. 'Sales_Manager_Perms'
- `label` (string, required): Display label
- `objectPermissions` (array): Object-level permissions to grant
- `tabSettings` (array): Tab visibility settings
- `userPermissions` (array): User-level permissions

### `sf_create_role` (~204 tokens)

Create Role

Creates a Role in the Salesforce role hierarchy. Roles control record visibility through role-based sharing. Users in higher roles can see records owned by users in subordinate roles. Specify a parentRole to place this role in the hierarchy, or omit it for a top-level role.

Input parameters:

- `accountAccessLevel` (string): Account and contact access level for subordinates
- `caseAccessLevel` (string): Case access level for subordinates
- `contactAccessLevel` (string): Contact access level for subordinates
- `description` (string): Description of this role
- `fullName` (string, required): Role API name, e.g. 'VP_Sales'
- `mayForecastManagerShare` (boolean): Grant manager forecast sharing
- `name` (string, required): Role display name, e.g. 'VP of Sales'
- `opportunityAccessLevel` (string): Opportunity access level for subordinates
- `parentRole` (string): Parent role API name (omit for top-level role)

### `sf_create_queue` (~168 tokens)

Create Queue

Creates a Queue in Salesforce. Queues are groups of users that can be assigned records (Cases, Leads, etc.). When a record is assigned to a queue, any queue member can work on it. Use for support teams, sales teams, or any scenario where multiple people share a pool of records to process.

Input parameters:

- `doesSendEmailToMembers` (boolean): Send email to all queue members when record is added
- `email` (string): Queue email address for notifications
- `fullName` (string, required): Queue API name, e.g. 'Support_Level_1'
- `name` (string, required): Queue display name
- `queueMembers` (object): Queue members
- `supportedObjects` (array, required): Object API names this queue supports, e.g. ['Case', 'Lead']

### `sf_create_named_credential` (~217 tokens)

Create Named Credential

Creates a Named Credential for making authenticated callouts to external systems from Apex or Flows. Named Credentials store the endpoint URL and authentication details securely, so developers don't hardcode credentials. Supports NoAuthentication, Basic (username/password), OAuth, and more. Use with sf_create_remote_site_setting to also allow the URL.

Input parameters:

- `allowCallout` (boolean): Allow callouts using this credential
- `allowFormula` (boolean): Allow formulas in HTTP body (enables merge fields)
- `endpoint` (string, required): Endpoint URL, e.g. 'https://api.example.com'
- `fullName` (string, required): Named credential API name, e.g. 'My_External_API'
- `label` (string, required): Display label
- `password` (string): Password for Password protocol (encrypted at rest)
- `principalType` (string): NamedUser: shared credentials. PerUserPrincipal: per-user OAuth. Anonymous: no auth.
- `protocol` (string): Authentication protocol
- `username` (string): Username for Password protocol

### `sf_create_role_hierarchy` (~126 tokens)

Create Role Hierarchy (Bulk)

Creates multiple Salesforce roles in the role hierarchy in a single call. Roles control record visibility — users in higher roles see records owned by subordinate-role users (depending on OWD settings). Use to set up an entire hierarchy at once.

roles: array of {fullName, name, parentRole?, description?}
  \- fullName: role API name (e.g. 'VP_Sales')
  \- name: display label
  \- parentRole: API name of parent role (omit for top-level)

Input parameters:

- `roles` (array, required): Roles to create in the hierarchy

### `sf_create_field_level_security` (~139 tokens)

Set Field Level Security

Sets field-level security (FLS) for a field across one or more profiles, controlling whether each profile can read and/or edit the field. Use after creating a custom field to make it visible and editable to the right profiles.

objectName: object API name
fieldName: field API name (e.g. 'Revenue__c')
profiles: array of {profileName, readable, editable}

Input parameters:

- `fieldName` (string, required): Field API name, e.g. 'Revenue__c'
- `objectName` (string, required): Object API name, e.g. 'Account'
- `profiles` (array, required): Profile-level field access settings

### `sf_get_field_permissions` (~151 tokens)

Get Field Level Security (Audit)

Reads the current field-level security grants for a field across all Profiles and Permission Sets that reference it, via the FieldPermissions query object. Use to audit who can currently see or edit a field before changing access, or to answer "which profiles can edit this field?". Complements sf_create_field_level_security, which sets grants but doesn't report the current state.

objectName: object API name, e.g. 'Account'
fieldName: field API name, e.g. 'Revenue__c'

Input parameters:

- `fieldName` (string, required): Field API name, e.g. 'Revenue__c' (without the object prefix)
- `objectName` (string, required): Object API name, e.g. 'Account'

### `sf_create_custom_permission` (~154 tokens)

Create Custom Permission

Creates a Custom Permission that can be checked in formulas with $Permission.MyPerm or in Apex with FeatureManagement.checkPermission('MyPerm'). Assign custom permissions to users via Permission Sets. Use for feature flags, conditional UI rendering, or access gates.

fullName: permission API name (e.g. 'Can_Approve_Discounts')
label: display label
description: optional description
requiredPermissions: other custom permissions required before this one can be granted

Input parameters:

- `description` (string): Description
- `fullName` (string, required): Custom permission API name, e.g. 'Can_Approve_Discounts'
- `label` (string, required): Display label
- `requiredPermissions` (array): Other custom permissions required by this one

### `sf_create_muting_permission_set` (~113 tokens)

Create Muting Permission Set

Creates a Muting Permission Set that removes specific permissions from users in a Permission Set Group. Use to create exceptions — e.g., a Permission Set Group grants broad access, and a Muting Permission Set removes a subset of that access for specific users.

fullName: muting permission set API name
label: display label
description: optional description

Input parameters:

- `description` (string): Description
- `fullName` (string, required): Muting permission set API name
- `label` (string, required): Display label

### `sf_create_permission_set_group` (~123 tokens)

Create Permission Set Group

Creates a Permission Set Group that aggregates multiple Permission Sets into a single assignable unit. Users assigned the group receive all permissions from all included permission sets. Simplifies administration when users need a combination of permissions.

fullName: Permission Set Group API name
label: display label
permissionSets: array of Permission Set API names to include

Input parameters:

- `description` (string): Description
- `fullName` (string, required): Permission Set Group API name
- `label` (string, required): Display label
- `permissionSets` (array, required): API names of permission sets to include

### `sf_create_lightning_app` (~202 tokens)

Create Lightning App

Creates a Lightning App in Salesforce — a branded navigation container with a custom navigation bar, utility bar, and logo. Choose between Standard (tabs) and Console (split view) navigation. Specify navItems to populate the navigation bar with objects, home, reports, etc. Use when a user wants a custom app experience for a specific team or use case.

Input parameters:

- `description` (string): Description
- `fullName` (string, required): App API name, e.g. 'Sales_Console'
- `isNavAutoTempTabsDisabled` (boolean)
- `isNavPersonalizationDisabled` (boolean)
- `label` (string, required): App display label
- `navItems` (array): Navigation bar items
- `navType` (string): Standard: tabs. Console: split view.
- `setupExperience` (string)
- `uiType` (string): Must be Lightning for modern apps
- `utilityItems` (array): Utility bar items

### `sf_create_tab` (~203 tokens)

Create Custom Tab

Creates a Custom Tab for a custom object so it appears in the navigation bar and App Launcher. Tabs are required to make custom objects accessible from the UI. Specify the object API name and choose a motif/icon from Salesforce's icon library (e.g., 'Custom64: Coin').

Input parameters:

- `customObject` (boolean): Set to true for custom object tabs
- `description` (string): Tab description
- `fullName` (string, required): Tab API name, typically same as the object API name, e.g. 'Invoice__c'
- `label` (string): Tab label (defaults to object label)
- `motif` (string): Icon/motif for the tab, e.g. 'Custom64: Coin', 'Custom1: default'
- `page` (string): Visualforce page name for VF tab
- `sobjectName` (string): Object API name if this is a custom object tab
- `url` (string): URL for web tab type

### `sf_create_compact_layout` (~156 tokens)

Create Compact Layout

Creates a Compact Layout for a Salesforce object. Compact Layouts define which fields appear in the highlights panel at the top of a record page (up to 10 fields), in Salesforce Mobile, and in related list cards. Use when you want to surface the most important fields at a glance.

Input parameters:

- `fields` (array, required): Field API names to show (max 10), e.g. ['Name', 'Status__c', 'Amount']
- `fullName` (string, required): Compact layout developer name
- `label` (string, required): Display label
- `objectName` (string, required): Object API name to add the compact layout to
- `setAsDefault` (boolean): Set this compact layout as the default for the object

### `sf_create_list_view` (~198 tokens)

Create List View

Creates a List View for any Salesforce object. List Views are saved filters that display a subset of records with specific columns, filters, and sorting. Use to create shared views like 'My Open Cases', 'High Priority Leads', or 'Deals Closing This Month' that appear in the object's list view selector.

Input parameters:

- `booleanFilter` (string): Boolean filter expression, e.g. '1 AND 2 OR 3'
- `columns` (array): Column field API names, e.g. ['Name', 'Account.Name', 'Status__c']
- `filterScope` (string): Base scope filter
- `filters` (array): Filter criteria
- `fullName` (string, required): List view developer name
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Account', 'Lead', 'Opportunity'
- `sharedTo` (object): Who can see this list view

### `sf_create_email_template` (~265 tokens)

Create Email Template

Creates an HTML or text email template that can be used in Workflow Email Alerts, Approval Processes, or sent manually. Templates support merge fields like {!Account.Name} for personalization. Specify a folder path (e.g., 'unfiled$public/MyTemplate') or 'MyFolder/MyTemplate'. Use relatedEntityType to enable object-specific merge fields.

Input parameters:

- `available` (boolean): Make template available for use
- `body` (string, required): Plain text body of the email
- `description` (string): Description
- `encoding` (string): Character encoding
- `fullName` (string, required): Full name including folder: 'FolderName/TemplateName' or 'unfiled$public/TemplateName'
- `htmlValue` (string): HTML body of the email (for html type templates)
- `label` (string, required): Display label
- `name` (string, required): Template developer name (no spaces)
- `relatedEntityType` (string): Related object API name, e.g. 'Opportunity', 'Contact'
- `replyTo` (string): Reply-to email address
- `senderName` (string): Sender display name
- `subject` (string, required): Email subject line (can include merge fields like {!Account.Name})
- `type` (string): Template type

### `sf_create_static_resource` (~165 tokens)

Create Static Resource

Creates a Static Resource from text/JSON/JS/CSS content. Static Resources are files stored in Salesforce and served via a CDN URL — ideal for JavaScript libraries, CSS stylesheets, JSON configuration, or any other file that needs to be served from Salesforce. Content is provided as a string and deployed via the Metadata API.

Input parameters:

- `cacheControl` (string): Cache control setting
- `content` (string, required): The file content as a string (text, JSON, JS, CSS, etc.)
- `contentType` (string): MIME type, e.g. 'application/json', 'text/css', 'application/javascript'
- `description` (string): Description of this resource
- `fullName` (string, required): Static resource API name, e.g. 'MyLibrary'

### `sf_create_custom_notification_type` (~121 tokens)

Create Custom Notification Type

Creates a Custom Notification Type that can be sent from Flows, Apex, or Process Builder using the Send Custom Notification action. Custom Notifications appear in Salesforce notification bell (and optionally mobile push). Use to create in-app alerts for important business events.

Input parameters:

- `customNotifTypeName` (string, required): Display name for the notification type
- `description` (string): Description
- `desktop` (boolean): Enable for desktop (web browser)
- `fullName` (string, required): Custom notification type API name
- `mobile` (boolean): Enable for mobile app

### `sf_create_report_type` (~150 tokens)

Create Custom Report Type

Creates a Custom Report Type that defines what objects and fields are available when building reports. A report type specifies a primary object and optionally related objects (joined via relationships). Use when the standard report types don't include the data you need, or when you want to create a specialized reporting structure.

Input parameters:

- `baseObject` (string, required): Primary object API name, e.g. 'Account', 'Opportunity'
- `category` (string): Report category for organization
- `deployed` (boolean): Deploy this report type immediately
- `description` (string): Description
- `fullName` (string, required): Report type developer name
- `label` (string, required): Display label
- `relationships` (array): Related object joins

### `sf_create_dashboard` (~130 tokens)

Create Dashboard

Creates a Salesforce Dashboard with components (charts, metrics, tables, gauges) powered by reports. Dashboards provide visual summaries of key business data. Specify the folder path as 'FolderName/DashboardName' and add components linked to existing reports. Use when a team needs a visual summary of their metrics.

Input parameters:

- `components` (array): Dashboard components
- `description` (string): Description
- `fullName` (string, required): Dashboard full name including folder: 'FolderName/DashboardName'
- `runningUser` (string): Username to run the dashboard as
- `title` (string, required): Dashboard title

### `sf_create_apex_class` (~212 tokens)

Create Apex Class

Creates and deploys an Apex class to the Salesforce org using the Metadata API. Accepts the full Apex source code including the class declaration. Use for any type of Apex class: service classes, controllers, batch classes, schedulable classes, queueable classes, test utilities, etc. IMPORTANT — If this class will be used as an Agentforce agent action: it MUST contain a public static method annotated with @InvocableMethod. Classes without @InvocableMethod cannot be invoked by agents and will silently fail at runtime. Example minimum structure: public class MyClass { @InvocableMethod(label='Do Thing' description='Does the thing') public static List<String> doThing(List<String> input) { ... } }

Input parameters:

- `apiVersion` (string): API version for this class, e.g. '66.0'
- `classBody` (string, required): Full Apex class source code including the class declaration
- `className` (string, required): Apex class name, e.g. 'AccountService'

### `sf_create_apex_trigger` (~166 tokens)

Create Apex Trigger

Creates and deploys an Apex Trigger on any Salesforce object. Specify the trigger events (before insert, after update, etc.) and the trigger body code. The trigger declaration (trigger Name on Object (events)) is auto-generated — just provide the code that goes inside the trigger body. Deployed via Metadata API SOAP deploy.

Input parameters:

- `apiVersion` (string): API version for this trigger
- `events` (array, required): Trigger events, e.g. ['before insert', 'before update']
- `objectName` (string, required): Object API name the trigger fires on, e.g. 'Account'
- `triggerBody` (string, required): Full trigger body code (the code between the trigger { })
- `triggerName` (string, required): Trigger name, e.g. 'AccountTrigger'

### `sf_create_apex_test_class` (~144 tokens)

Create Apex Test Class

Creates and deploys an Apex Test Class (annotated with @isTest). Provide the full test class source code. Optionally run the tests immediately after deployment. Test classes are required for Salesforce deployments to production (minimum 75% code coverage). Use for unit testing Apex classes, triggers, and business logic.

Input parameters:

- `apiVersion` (string): API version for this test class
- `classBody` (string, required): Full test class source code including @isTest annotation and class declaration
- `className` (string, required): Test class name, e.g. 'AccountServiceTest'
- `runAfterDeploy` (boolean): Immediately run the tests after deploying

### `sf_run_apex_tests` (~107 tokens)

Run Apex Tests

Runs one or more Apex test classes and returns pass/fail results with any error messages. Uses the Salesforce Tooling API runTestsAsynchronous endpoint and polls for results. Use after deploying Apex code to verify test coverage, or to run regression tests before a release.

Input parameters:

- `testClasses` (array, required): List of test class names to run, e.g. ['AccountServiceTest', 'ContactTriggerTest']
- `waitMinutes` (integer): Max minutes to wait for test results

### `sf_execute_anonymous_apex` (~95 tokens)

Execute Anonymous Apex

Executes anonymous Apex code in the Salesforce org using the Tooling API executeAnonymous endpoint. Returns compile errors, runtime exceptions, and debug log output. Use for one-off data fixes, testing Apex snippets, creating test data, running utilities, or debugging. Code runs in the context of the authenticated user.

Input parameters:

- `apexCode` (string, required): Anonymous Apex code to execute, e.g. 'System.debug(Date.today());'

### `sf_scan_apex_antipatterns` (~133 tokens)

Scan Apex for Anti-Patterns

Scans Apex classes in the org for common anti-patterns using the Tooling API. Detects SOQL/DML in loops, hardcoded Salesforce IDs, and debug statements left in production code. Use before deploying to catch performance and quality issues early.

classNames: optional list of class names to scan (omits test classes with __Test suffix)
maxClasses: maximum classes to scan (default 20, max 200)

Input parameters:

- `classNames` (array): Apex class names to scan (omit to scan all)
- `maxClasses` (integer): Maximum number of classes to scan

### `sf_run_code_scanner` (~325 tokens)

Run Code Analyzer (PMD/ESLint/RetireJS/SFGE)

Runs Salesforce Code Analyzer against Apex classes in the org — a real multi-engine static analysis scan (PMD rules including ApexCRUDViolation and OperationWithLimitsInLoop, SFGE data-flow analysis for SOQL injection, RetireJS for vulnerable JS libraries, ESLint, and Salesforce's regex engine), on top of the lighter-weight sf_scan_apex_antipatterns heuristic check. Retrieves class bodies via the Tooling API into a temp workspace, runs the scanner, and cleans up afterward. PMD/CPD/SFGE engines require Java 11+ on the host running this MCP server — if Java isn't detected, the scan automatically falls back to the Java-free engines (eslint, retire-js, regex, flow) and flags this in the response rather than failing.

classNames: optional list of class names to scan (omit to scan all active classes)
maxClasses: maximum classes to scan (default 20, max 200)
ruleSelector: optional override, e.g. ['pmd:Security'] — defaults to 'Recommended' rules (auto-restricted per the Java note above)

Input parameters:

- `classNames` (array): Apex class names to scan (omit to scan all active classes)
- `maxClasses` (integer): Maximum number of classes to scan
- `ruleSelector` (array): Override rule selectors, e.g. ['pmd:Security', 'eslint:Recommended']. Defaults to 'Recommended' rules, auto-restricted to non-Java engines (eslint, retire-js, regex, flow) if Java isn't detected on t…

### `sf_get_apex_class` (~113 tokens)

Get Apex Class Source

Retrieves the full source code of an existing Apex class by exact name, via the Tooling API. Use before modifying a class (to see current logic), when debugging, or when a user asks "show me the X class" / "what does this class do". Returns the class body, API version, and status. Not to be confused with sf_create_apex_class, which deploys new or updated code — this tool only reads.

Input parameters:

- `className` (string, required): Apex class name to retrieve

### `sf_get_apex_trigger` (~105 tokens)

Get Apex Trigger Source

Retrieves the full source code of an existing Apex trigger by exact name, via the Tooling API. Returns the trigger body, the object it fires on, its active status, and which trigger events (before/after insert/update/delete/undelete) it's registered for. Use before modifying a trigger, or when a user asks to see or explain an existing trigger.

Input parameters:

- `triggerName` (string, required): Apex trigger name (exact match), e.g. 'AccountTrigger'

### `sf_create_lwc` (~248 tokens)

Create Lightning Web Component

Creates and deploys a new Lightning Web Component (LWC) to the Salesforce org. Provide the HTML template, JavaScript controller, optional CSS, and component metadata. The component is packaged into a deployment zip and deployed via the Metadata API. Specify targets to make the component available in Lightning App Builder (AppPage, RecordPage, HomePage), Flow Screen, Utility Bar, or Experience Cloud. Use isExposed:true to make it drag-and-drop in App Builder.

Input parameters:

- `apiVersion` (string): API version for this component
- `componentName` (string, required): LWC component name in camelCase, e.g. 'accountCard', 'opportunityList'
- `css` (string): Optional CSS styles content
- `description` (string): Description of the component
- `html` (string, required): HTML template content (the content of the .html file, including <template> tags)
- `isExposed` (boolean): Make the component available in Lightning App Builder
- `javascript` (string, required): JavaScript controller content (the content of the .js file, including import statements and class)
- `targets` (array): Where this component can be placed in Lightning

### `sf_update_lwc` (~142 tokens)

Update Lightning Web Component

Updates an existing Lightning Web Component by redeploying it with updated HTML, JavaScript, or CSS. Provide only the files you want to update — any files omitted will use empty placeholders (so you should provide all files you want to keep). The component is redeployed via the Metadata API.

Input parameters:

- `apiVersion` (string): API version
- `componentName` (string, required): Existing LWC component name to update
- `css` (string): Updated CSS (leave undefined to keep existing)
- `html` (string): Updated HTML template (leave undefined to keep existing)
- `javascript` (string): Updated JavaScript controller (leave undefined to keep existing)

### `sf_create_lwc_jest_test` (~148 tokens)

Create LWC Jest Test

Creates a Jest test file for an existing LWC component using @salesforce/lwc-jest conventions. The test file is placed in the __tests__ subfolder of the component bundle and deployed via the Metadata API.

componentName: LWC component name in camelCase, e.g. 'myButton'
testContent: Jest test file content (JavaScript)
apiVersion: Salesforce API version

Input parameters:

- `apiVersion` (string): API version, e.g. '62.0'
- `componentName` (string, required): LWC component name (camelCase), e.g. 'myButton'
- `testContent` (string, required): Jest test file content (JavaScript)

### `sf_guide_lwc_accessibility` (~105 tokens)

LWC Accessibility Guidance

Returns guidance and a checklist for LWC accessibility best practices covering ARIA attributes, keyboard navigation, focus management, and screen reader support. A read-only advisory tool — does not modify the org.

componentName: optional component name for context
checklistOnly: return only the checklist items without detailed guidance

Input parameters:

- `checklistOnly` (boolean): Return only the checklist without detailed guidance
- `componentName` (string): LWC component name for context (optional)

### `sf_migrate_aura_to_lwc` (~127 tokens)

Migrate Aura Component to LWC

Analyzes an Aura component and returns a comprehensive migration guide with Aura-to-LWC concept mappings, key differences, and an optional LWC scaffold. A read-only advisory tool — does not modify the org.

auraComponentName: the Aura component name to analyze
includeScaffold: whether to generate equivalent LWC template, JS, CSS, and meta files

Input parameters:

- `auraComponentName` (string, required): Aura component name to analyze, e.g. 'MyAuraComponent'
- `includeScaffold` (boolean): Whether to generate equivalent LWC scaffold code

### `sf_create_lwc_from_requirements` (~173 tokens)

Generate LWC from Requirements

Generates a complete LWC component scaffold (HTML template, JS controller, CSS, and meta XML) from a plain-English requirements description. Returns the generated code for review before deploying with sf_create_lwc.

componentName: LWC component name in camelCase
requirements: plain-English description of what the component should do
includeWireAdapters: include @wire adapter examples for data fetching
targetObject: optional Salesforce object to bind to

Input parameters:

- `componentName` (string, required): LWC component name in camelCase, e.g. 'accountTile'
- `includeWireAdapters` (boolean): Include wire adapter examples in the component
- `requirements` (string, required): Plain-English description of what the component should do
- `targetObject` (string): Salesforce object to bind to, e.g. 'Account'

### `sf_explore_slds_blueprints` (~126 tokens)

Explore SLDS Component Blueprints

Returns Salesforce Lightning Design System (SLDS) component examples, best practices, and usage guidance for a given UI pattern. A read-only reference tool — does not modify the org.

componentType: SLDS component type, e.g. 'data-table', 'modal', 'combobox'
includeExampleCode: whether to include example LWC code snippets

Input parameters:

- `componentType` (string, required): SLDS component type, e.g. 'data-table', 'modal', 'combobox'
- `includeExampleCode` (boolean): Whether to include example LWC code

### `sf_create_experience_site` (~208 tokens)

Create Experience Cloud Site

Creates an Experience Cloud site (formerly Community) using a specified template. Supported templates: CustomerService (B2C self-service), Partner (B2B partner portal), LWR (Lightning Web Runtime — high performance), Aloha (App Launcher), Microsites (standalone pages). The urlPathPrefix appears in the site URL (e.g., 'customers' → org.force.com/customers). Site starts in UnderConstruction status by default.

Input parameters:

- `description` (string): Site description
- `guestUserProfile` (string): Guest user profile API name (default: '<SiteName> Profile')
- `label` (string, required): Site display label
- `siteName` (string, required): Site API name, e.g. 'CustomerPortal'
- `status` (string): Initial site status
- `template` (string): Experience Cloud template to use
- `urlPathPrefix` (string, required): URL path prefix, e.g. 'customers' → https://org.force.com/customers

### `sf_create_experience_page` (~126 tokens)

Create Experience Cloud Page

Creates a page within an existing Experience Cloud site. Pages can be standard (home, login, profile, object detail, object list) or custom. The page URL path is relative to the site's URL prefix. Use after creating the site to add additional pages for different content sections.

Input parameters:

- `label` (string, required): Page display label
- `pageName` (string, required): Page developer name
- `siteName` (string, required): Experience site API name
- `type` (string): Page type
- `url` (string): Page URL path, e.g. '/my-page'

### `sf_create_agent` (~433 tokens)

Create Agentforce Agent

Creates an Agentforce Agent (Einstein Copilot) shell in Salesforce. THIS IS STEP 1 OF A 5-STEP SEQUENCE — calling this tool alone produces a non-functional agent shell. You MUST continue calling tools in this exact order without stopping: (0) FIRST create the backing flows (sf_create_flow, flowType=AutoLaunchedFlow, status=Active) and/or Apex classes (sf_create_apex_class with @InvocableMethod) for each capability. (1) THIS TOOL — sf_create_agent. (2) sf_create_agent_action — one call per flow/apex. (3) sf_create_agent_topic — group actions into topics; pass all action API names in the 'actions' array. (4) sf_create_agent_planner — wire topics to the agent. DO NOT report completion to the user until sf_create_agent_planner succeeds. Do not ask the user for confirmation between steps — proceed through all steps autonomously.

Input parameters:

- `agentName` (string, required): Agent API name — letters and numbers only, NO underscores (Salesforce rejects underscores in Bot developer names). Max 40 chars. e.g. 'SalesAgent', 'SupportBot'. Used in all subsequent calls (sf_crea…
- `company` (string): Company name for the agent's context
- `description` (string): Agent description
- `label` (string, required): Agent display label shown to users, e.g. 'Sales Assistant'
- `persona` (string): Agent persona/role description, e.g. 'A knowledgeable sales expert who helps close deals'. Deployed as the BotVersion <role>.
- `plannerName` (string): API name of the GenAiPlannerBundle to attach this agent to. Normally omitted on the first call (the planner does not exist yet) — after sf_create_agent_planner succeeds, call this tool again with the…
- `tone` (string): Communication tone for agent responses

### `sf_create_agent_topic` (~332 tokens)

Create Agentforce Topic

Creates a Topic (GenAiPlugin) for an Agentforce Agent — step 3 of the agent setup sequence. Call this AFTER all actions have been created with sf_create_agent_action. CRITICAL: pass ALL action API names in the 'actions' array — omitting it creates a topic with no executable actions and the agent silently does nothing. agentName is informational only (not written to XML) — the actual agent→topic wiring happens in sf_create_agent_planner which you MUST call immediately after this step. Do not stop between steps.

Input parameters:

- `actions` (array): CRITICAL: Action API names (from sf_create_agent_action) to link to this topic. If you omit this or pass an empty array, the topic is created with NO executable actions — the agent will silently do n…
- `agentName` (string, required): Parent agent API name — informational only, NOT written to the topic XML. The actual agent→topic wiring happens in sf_create_agent_planner (required separate step).
- `description` (string, required): What this topic covers
- `instructions`: Step-by-step instructions for handling this topic. Pass as a single string or an array of strings (each becomes a separate instruction entry).
- `label` (string, required): Topic label
- `scope` (string, required): Scope of this topic — what kind of requests it handles
- `topicName` (string, required): Topic API name, e.g. 'OrderManagement'. Letters, numbers, underscores. This is the name you must include in topicNames when calling sf_create_agent_planner.

### `sf_create_agent_planner` (~311 tokens)

Wire Agent to Topics — Final Step (Create GenAiPlanner)

Creates a GenAiPlanner that connects an Agentforce Agent (Bot) to its Topics — STEP 4 (FINAL) of the agent setup sequence. Without this step the agent cannot route ANY request regardless of how many topics and actions were created. Also known as: linking topics to agent, connecting topics, finishing agent setup, wiring topics, registering topics. CRITICAL: topicNames must be the COMPLETE list of all topics — this REPLACES any existing planner, so omitting a topic removes it from the agent. When adding a new topic to an existing agent, include ALL previous topic names plus the new one. Only AFTER this step succeeds should you report completion to the user.

Input parameters:

- `actionNames` (array): Action API names to attach directly to the planner rather than through a topic (e.g. a knowledge action). Most agents leave this empty and put actions in topics.
- `agentName` (string, required): Agent API name — must exactly match the agentName used in sf_create_agent (no underscores).
- `description` (string): Planner description. Required by Salesforce — defaults to a generated description if omitted.
- `label` (string): Planner display label (defaults to agentName)
- `topicNames` (array, required): COMPLETE list of topic API names to wire to this agent. WARNING: This REPLACES any existing planner — if you add a new topic to an existing agent, include ALL previous topic names plus the new one. O…

### `sf_create_agent_action` (~433 tokens)

Create Agentforce Action

Creates an Agentforce Action (GenAiFunction) — step 2 of the agent setup sequence. Call this once per capability (once per flow, once per Apex class). IMPORTANT by type: For Flow — the flow must already exist as an Active AutoLaunchedFlow (use sf_create_flow with flowType='AutoLaunchedFlow' and status='Active' first). For ApexClass — the class must already exist AND have @InvocableMethod (use sf_create_apex_class first). The 'reference' is the exact API name of the flow or class. After ALL actions are created, call sf_create_agent_topic (passing all action API names in 'actions' array), then sf_create_agent_planner. Do not stop between steps.

Input parameters:

- `actionName` (string, required): Action API name. Letters, numbers, underscores. Remember this name — you must pass it in the 'actions' array when calling sf_create_agent_topic.
- `agentName` (string): Parent agent API name — optional and informational only, NOT written to the action XML. Safe to omit.
- `description` (string, required): What this action does — used by the AI to decide when to invoke it
- `inputs` (array): Input parameter mappings
- `label` (string): Action label. Defaults to actionName if omitted.
- `reference` (string, required): Exact API name of the resource to invoke. For Flow: the flow API name (e.g. 'Get_Account_Details'). For ApexClass: the class name (e.g. 'AccountHelper'). For PromptTemplate: the template API name. Mu…
- `topicName` (string): Parent topic API name — optional and informational only, NOT written to the action XML. Safe to omit. You must still pass this action's API name (actionName) in the 'actions' array when calling sf_cr…
- `type` (string, required): Action type: 'Flow' (AutoLaunchedFlow only — must be Active), 'ApexClass' (must have @InvocableMethod), 'PromptTemplate', etc.

### `sf_create_outbound_change_set` (~119 tokens)

Create Outbound Change Set

Creates an Outbound Change Set in the org — a container for metadata components that can be deployed to connected orgs (sandbox → production). Optionally adds specified components immediately. Returns the change set ID and a link to view it in Setup. Use this before deploying to production when using the change set deployment model.

Input parameters:

- `changeSetName` (string, required): Name for the outbound change set
- `components` (array): Metadata components to add to the change set
- `description` (string): Description of what this change set contains

### `sf_add_to_change_set` (~97 tokens)

Add Components to Change Set

Adds one or more metadata components to an existing Outbound Change Set by change set name. Supports all metadata types: CustomObject, CustomField, ApexClass, ApexTrigger, Flow, ValidationRule, PermissionSet, etc. Use after creating a change set to add the metadata you want to deploy.

Input parameters:

- `changeSetName` (string, required): Name of the existing outbound change set
- `components` (array, required): Components to add

### `sf_deploy_metadata` (~255 tokens)

Deploy Metadata

Deploys a set of metadata components directly to the org using the Metadata API SOAP deploy operation. Builds a package.xml and deployment zip in memory. Supports validate-only (checkOnly:true) for pre-deployment validation without making changes. Specify runTests to execute test classes during deployment (required for production). Polls until complete or timeout.

Input parameters:

- `checkOnly` (boolean): Validate only, do not actually deploy
- `components` (array): Metadata components to include in the deployment package. These reference components already in the org. Can be empty when using componentsXml to deploy new/updated components with inline XML.
- `componentsXml` (array): Optional inline XML components to deploy. Each entry provides the complete XML definition (type, name, xml). The file path is inferred from type/name. When provided alongside components, both are dep…
- `rollbackOnError` (boolean): Roll back all changes if any component fails
- `runTests` (array): Test classes to run during deployment
- `testLevel` (string): Test level: NoTestRun, RunSpecifiedTests, RunLocalTests, or RunAllTestsInOrg
- `waitMinutes` (integer): Max minutes to wait for deploy to complete

### `sf_check_deploy_status` (~84 tokens)

Check Deployment Status

Checks the status of an in-progress or recently completed metadata deployment by async job ID. Returns the status (Pending, InProgress, Succeeded, Failed, Canceled), component successes, failures, and test results. Use with the deploy ID returned from sf_deploy_metadata.

Input parameters:

- `deployId` (string, required): Deploy async job ID returned from sf_deploy_metadata

### `sf_retrieve_metadata` (~147 tokens)

Retrieve Metadata

Retrieves metadata components from the org and returns their actual file contents. Use this to read existing configuration before making changes, to back up metadata, or to check what is really deployed rather than what you think is deployed. Waits for the async retrieve to finish and unpacks the resulting zip, returning each file's path and source. Large files are truncated.

Input parameters:

- `componentName` (string): Single component name (used with metadataType)
- `components` (array): Metadata components to retrieve
- `metadataType` (string): Single metadata type (alternative to components array)
- `packageXml` (string): Raw package.xml content for selective retrieve. If provided, components list is ignored.

### `sf_create_mcp_server` (~187 tokens)

Create Salesforce MCP Server

Generates a complete, working MCP server project structure on disk targeting a Salesforce org. Creates package.json, tsconfig.json, src/index.ts entry point, .env.example, and README.md. The generated server uses the MCP SDK and includes a sample 'hello_world' tool. Provide an outputDirectory (absolute path) where the files will be written. After generation, run 'npm install' then 'npm run build' in that directory.

Input parameters:

- `description` (string): Server description
- `outputDirectory` (string, required): Absolute path to directory where files will be created, e.g. 'C:/projects/my-server'
- `salesforceInstanceUrl` (string): Salesforce instance URL to pre-configure, e.g. 'https://myorg.salesforce.com'
- `serverName` (string, required): Name for the new MCP server, e.g. 'my-salesforce-server'

### `sf_create_mcp_tool` (~165 tokens)

Add Tool to MCP Server

Adds a new tool definition to an existing MCP server project by reading the src/index.ts file and appending the tool registration. Provide the tool name, description, input schema as a JSON object (field names to {type, description}), and handler code. The tool code is inserted before the 'Start server' section. Run 'npm run build' after adding tools.

Input parameters:

- `handlerCode` (string, required): TypeScript handler function body code
- `inputSchema` (object, required): JSON Schema for the tool's input parameters
- `projectDirectory` (string, required): Absolute path to the MCP server project directory
- `toolDescription` (string, required): Detailed description of what the tool does
- `toolName` (string, required): Tool API name, e.g. 'get_account_data'

### `sf_list_mcp_tools` (~70 tokens)

List MCP Server Tools

Lists all tools currently registered in a given MCP server project by reading and parsing its src/index.ts file. Returns the tool names in the order they are registered. Use to audit what tools exist before adding new ones.

Input parameters:

- `projectDirectory` (string, required): Absolute path to the MCP server project directory

### `sf_create_connected_app` (~448 tokens)

Create Connected App (OAuth)

Creates a Connected App in Salesforce to enable OAuth authentication for external applications. Connected Apps are required for any external system that wants to connect to Salesforce via OAuth 2.0. Specify callback URLs for the OAuth flow, OAuth scopes (api, web, full, offline_access, etc.), and contact email. Used for web apps, mobile apps, desktop apps, or server-to-server integrations.

Input parameters:

- `accessTokenValidity` (integer): Access token validity in minutes
- `callbackUrls` (array, required): OAuth callback URLs, e.g. ['https://myapp.com/oauth/callback']
- `consumerKey` (string): Custom consumer key (auto-generated if not specified)
- `contactEmail` (string, required): Contact email for the app
- `description` (string): Description
- `enableClientCredentialsFlow` (boolean): Sets isClientCredentialEnabled/isAdminApproved on the deployed ConnectedApp (verified accepted by Metadata API 2026-07-31). NOTE: Salesforce still requires an admin to open Setup → App Manager → Edit…
- `fullName` (string, required): Connected app API name, e.g. 'My_External_App'
- `label` (string, required): Display label
- `refreshTokenValidity` (integer): Refresh token validity in minutes
- `scopes` (array, required): OAuth scopes to request. Use 'chatbot_api' (deploys as the metadata literal 'Chatbot', verified against a live org 2026-07-31) for any external client calling a Salesforce bot/Agentforce agent — with…
- `startUrl` (string): Default start URL after OAuth

### `sf_create_external_client_app` (~599 tokens)

Create External Client App (OAuth) — recommended over Connected App

Creates an External Client App (ECA), Salesforce's newer replacement for Connected Apps, for OAuth authentication and server-to-server integrations. Prefer this over sf_create_connected_app: on ECAs, Client Credentials Flow — including which user it runs as — is fully configurable via this tool (enableClientCredentialsFlow + clientCredentialsFlowUser), whereas on classic Connected Apps that same setting can only be picked in Setup UI. Deploys all 3 underlying metadata records (ExternalClientApplication, ExtlClntAppOauthSettings, ExtlClntAppOauthConfigurablePolicies) in one call. Use 'Chatbot' and/or 'SFApiPlatform' scopes for any app that needs to call the Salesforce Agent API (e.g. testing an Agentforce agent's conversation flow) or a bot's Messaging API. NOTE: the Consumer Key/Secret this app needs to actually mint a token can still only be viewed once in Setup → External Client Apps → [name] → Settings → OAuth Settings — no Salesforce API exposes it, for either app type.

Input parameters:

- `clientCredentialsFlowUser` (string): Username to run Client Credentials Flow requests as (e.g. 'admin@myorg.com'). Required by Salesforce if enableClientCredentialsFlow is true. This IS settable via the Metadata API for External Client…
- `contactEmail` (string, required): Contact email for the app
- `description` (string): Description
- `enableClientCredentialsFlow` (boolean): Sets isClientCredentialsFlowEnabled=true on ExtlClntAppOauthConfigurablePolicies.
- `fullName` (string, required): External Client App API name, e.g. 'My_External_App'. Used for all three underlying metadata records (ExternalClientApplication, ExtlClntAppOauthSettings, ExtlClntAppOauthConfigurablePolicies) — this…
- `ipRelaxationPolicyType` (string): IP restriction enforcement for this app's OAuth tokens.
- `label` (string, required): Display label
- `permittedUsersPolicyType` (string): Who can authorize this app. AdminApprovedPreAuthorized (recommended for Client Credentials Flow) restricts use to explicitly pre-authorized profiles/permission sets. Defaults to Salesforce's own defa…
- `refreshTokenPolicyType` (string): Refresh token expiry strategy.
- `scopes` (array, required): OAuth scopes to request, using Salesforce's exact enum literals (PascalCase — this is the ExtlClntAppOauthSettings.commaSeparatedOauthScopes enum, unrelated to the lowercase OAuth2 scope-string conve…

### `sf_create_external_data_source` (~183 tokens)

Create External Data Source

Creates an External Data Source for Salesforce Connect, enabling read-write access to data stored outside Salesforce without importing it. Supports OData 2.0/4.0 for standard REST services, SimpleURL for basic access, Apex for custom adapters. The external data then appears as External Objects (__x) in Salesforce.

Input parameters:

- `description` (string): Description
- `endpoint` (string, required): Endpoint URL
- `fullName` (string, required): External data source API name
- `label` (string, required): Display label
- `password` (string): Password for Password protocol
- `principalType` (string): Authentication principal type
- `protocol` (string): Authentication protocol
- `type` (string): Connection type: SimpleURL for basic, OData2/OData4 for OData, Apex for custom
- `username` (string): Username for Password protocol

### `sf_create_external_object` (~164 tokens)

Create External Object

Creates an External Object (ending in __x) linked to an External Data Source. External Objects look like regular Salesforce objects but their data lives in an external system. They support lookups from standard/custom objects, appear in related lists, and can be used in reports. Requires an existing External Data Source.

Input parameters:

- `description` (string): Description
- `externalDataSource` (string, required): External data source API name to link to
- `externalName` (string): Name in the external system (table/entity name)
- `fields` (array): Custom fields to add
- `fullName` (string, required): External object API name, e.g. 'Product__x'
- `label` (string, required): Singular label
- `pluralLabel` (string, required): Plural label

### `sf_create_remote_site_setting` (~161 tokens)

Create Remote Site Setting

Creates a Remote Site Setting to allow an external URL for Apex callouts. Salesforce blocks outbound HTTP calls by default — adding a Remote Site Setting allows Apex code to call that URL. Required for any external API callout from Apex or Flows. Use with sf_create_named_credential for authenticated callouts.

Input parameters:

- `description` (string): Description of why this site is trusted
- `disableProtocolSecurity` (boolean): Disable protocol security (not recommended)
- `fullName` (string, required): Remote site setting API name
- `isActive` (boolean): Whether this remote site setting is active
- `name` (string, required): Display name
- `url` (string, required): URL to allow for callouts, e.g. 'https://api.example.com'

### `sf_create_csp_setting` (~145 tokens)

Create Content Security Policy (CSP) Trusted Site

Creates a Content Security Policy trusted site, allowing LWC components and Visualforce pages to load resources from external URLs. CSP settings are needed when your LWC uses external JavaScript libraries, fonts, images, or APIs. Specify which directives (connect-src, script-src, style-src, img-src, etc.) the URL is trusted for.

Input parameters:

- `cspDirectives` (array, required): CSP directives this URL is trusted for
- `description` (string): Description of why this URL is trusted
- `endpointUrl` (string, required): Trusted URL for CSP, e.g. 'https://cdn.example.com'
- `isActive` (boolean): Whether this setting is active

### `sf_create_report` (~199 tokens)

Create Salesforce Report

Creates a Salesforce Report using the Report metadata type. Supports Tabular, Summary, Matrix, and Joined formats. Specify the report type (e.g., Accounts, Opportunities), columns to display, and optional filters. Reports are created in the specified folder or your personal folder by default.

Input parameters:

- `columns` (array, required): Field API names to include as columns, e.g. ['ACCOUNT_NAME', 'ANNUAL_REVENUE']
- `description` (string): Report description
- `filters` (array): Report filters
- `folderName` (string): Folder API name for the report
- `format` (string): Report format
- `groupByField` (string): Field to group by (Summary/Matrix formats)
- `label` (string, required): Report display name
- `reportName` (string, required): Report API name
- `reportType` (string, required): Report type API name, e.g. 'Account', 'Opportunity', 'AccountList'

### `sf_update_dashboard` (~116 tokens)

Update Dashboard

Updates an existing Dashboard's title or description by reading the current configuration from the org and applying changes. The dashboard must already exist. For structural changes (adding/removing components), use sf_create_dashboard to create a new version.

Input parameters:

- `componentsToAdd` (array): Dashboard components to add
- `componentsToRemove` (array): Component titles to remove
- `dashboardName` (string, required): Dashboard API name
- `label` (string): New dashboard title/label
- `runningUser` (string): Username to run dashboard as

### `sf_create_report_folder` (~107 tokens)

Create Report or Dashboard Folder

Creates a folder for organizing Reports or Dashboards. Folder access types: Hidden (only owner), Shared (explicit sharing), Public (all users). After creating, use sf_share_report_folder to grant access to specific users, roles, or groups.

Input parameters:

- `accessType` (string): Folder access type
- `folderName` (string, required): Folder API name
- `folderType` (string): Whether this is a report or dashboard folder
- `label` (string, required): Folder display name

### `sf_share_report_folder` (~111 tokens)

Share Report or Dashboard Folder

Shares a Report or Dashboard folder with users, roles, groups, or territories. Sets access levels (View, Edit, Manage) per share recipient. Use after creating a folder to grant team members access.

Input parameters:

- `accessLevel` (string): Access level shorthand: View, Edit, Manage
- `folderName` (string, required): Folder API name to share
- `folderType` (string): Whether this is a report or dashboard folder
- `shareWith` (array, required): Who to share the folder with

### `sf_create_user` (~252 tokens)

Create Salesforce User

Creates a new Salesforce user via the REST API. Requires username (must be unique and email-like), lastName, email, and profileName. The profile must already exist. Optionally assign a role by roleApiName (DeveloperName of the UserRole). The user will receive a welcome email unless email confirmations are suppressed in org settings.

Input parameters:

- `alias` (string, required): User alias (max 8 chars, shown in list views)
- `email` (string, required): Email address (also used for notifications)
- `emailEncoding` (string): Email encoding
- `firstName` (string): First name
- `languageLocale` (string): Language and locale, e.g. 'en_US'
- `lastName` (string, required): Last name
- `locale` (string): Locale, e.g. 'en_US'
- `profileName` (string, required): Profile name, e.g. 'Standard User', 'System Administrator'
- `roleName` (string): Role name to assign, e.g. 'CEO'
- `timeZone` (string): Timezone, e.g. 'America/New_York'
- `username` (string, required): Unique username (must be email format and unique across all Salesforce orgs)

### `sf_update_user` (~145 tokens)

Update Salesforce User

Updates an existing Salesforce user's properties via the REST API. Look up the user by username and update fields like firstName, lastName, email, title, department, phone, or isActive (to deactivate/reactivate). Only fields you provide are updated.

Input parameters:

- `additionalFields` (object): Additional User SObject fields to update, e.g. {Department: 'Sales', Title: 'Manager'}
- `isActive` (boolean): Activate or deactivate the user
- `profileName` (string): New profile name
- `roleName` (string): New role name (or empty string to remove role)
- `username` (string, required): Username to identify the user to update

### `sf_assign_queue_member` (~118 tokens)

Add User to Queue

Adds a user to an existing Queue (GroupMember SObject) by username and queue DeveloperName. The queue must already exist (create via sf_create_queue). Users in queues can be assigned records and receive queue notification emails.

Input parameters:

- `queueDeveloperName` (string, required): Queue developer name (DeveloperName field on Group), e.g. 'Support_Tier1'
- `roles` (array): Role API names to add to the queue (adds all users in the role)
- `users` (array): Usernames to add to the queue

### `sf_create_public_group` (~92 tokens)

Create Public Group

Creates a Public Group (Group SObject with Type=Regular) for sharing rules, email distribution, or queue membership. Public groups can include users, roles, and other groups. Use as a sharing target in sf_create_sharing_rule.

Input parameters:

- `groupName` (string, required): Group developer name (no spaces)
- `label` (string, required): Group display name
- `members` (array): Initial group members

### `sf_query_records` (~157 tokens)

Query Records (SOQL)

Executes a SOQL query against the org and returns matching records. Provide the full SOQL string in the query param. Use for reading data, checking existing records before creating, or verifying changes.

Supports aggregate queries — GROUP BY with COUNT(), SUM(), AVG(), MAX(), MIN(), e.g.:
'SELECT StageName, COUNT(Id), SUM(Amount) FROM Opportunity GROUP BY StageName'
Aggregate results come back as regular records with the aggregate expressions as field keys (e.g. "expr0").

Input parameters:

- `limit` (integer): Maximum records to return (default 200)
- `query` (string, required): Full SOQL query string, e.g. 'SELECT Id, Name FROM Account WHERE Industry = \'Technology\' LIMIT 10'

### `sf_describe_object` (~206 tokens)

Describe Object Schema

Retrieves schema metadata for a Salesforce object via the REST Describe API: fields (name, label, type, required, picklist values, length, references), child relationships, and record type info. Call this before querying or creating records on an unfamiliar object, or when a user asks what fields exist on an object.

objectApiName: SObject API name, e.g. 'Account', 'My_Object__c'
fieldsOnly: set true for a smaller/faster response with just the field list, omitting child relationships and record types

Input parameters:

- `fieldsOnly` (boolean): If true, returns only the field list (name, label, type, required, picklist values) and omits child relationships/record type info — use for a smaller, faster response when you only need field names/…
- `objectApiName` (string, required): SObject API name to describe, e.g. 'Account', 'My_Object__c'

### `sf_create_record` (~111 tokens)

Create SObject Record

Creates a single SObject record via the Salesforce REST API. Provide the object API name and a fields object with field API names and values. For bulk creation (100+ records), use sf_bulk_import_records instead.

Input parameters:

- `fields` (object, required): Key-value pairs of field API names to values, e.g. {Name: 'Acme', Industry: 'Technology'}
- `objectApiName` (string, required): SObject API name, e.g. 'Account', 'Contact', 'My_Object__c'

### `sf_update_record` (~106 tokens)

Update SObject Record

Updates an existing SObject record by record ID via the Salesforce REST API. Provide the object API name, the 15 or 18 character record ID, and the fields to update. Only provided fields are changed — omitted fields retain their current values.

Input parameters:

- `fields` (object, required): Key-value pairs of field API names to update values
- `objectApiName` (string, required): SObject API name
- `recordId` (string, required): Salesforce record ID (15 or 18 chars)

### `sf_bulk_import_records` (~153 tokens)

Bulk Import Records (Bulk API 2.0)

Bulk imports records using the Salesforce Bulk API 2.0. Supports insert, upsert, update, and delete operations on large datasets (thousands to millions of records). Provide CSV data with a header row. For upsert, set externalIdField to the field used for matching. Polls until the job completes and returns success/failure counts.

Input parameters:

- `externalIdField` (string): External ID field for upsert operations, e.g. 'External_Id__c'
- `objectApiName` (string, required): SObject API name, e.g. 'Account'
- `operation` (string, required): Bulk operation type
- `records` (array, required): Array of record objects with field API name to value mappings

### `sf_delete_record` (~130 tokens)

Delete SObject Record

Deletes a single SObject record by record ID via the Salesforce REST API. The deletion is permanent and cannot be undone (the record goes to the Recycle Bin for objects that support it, from where it can be undeleted within 15 days).

Provide the object API name and the 15 or 18 character record ID. For bulk deletions (100+ records), use sf_bulk_import_records with operation='delete'.

Input parameters:

- `objectApiName` (string, required): SObject API name, e.g. 'Account'
- `recordId` (string, required): 15 or 18 character Salesforce record ID

### `sf_send_email` (~299 tokens)

Send Email via Salesforce

Sends an email from Salesforce using the emailSimple invocable action. The email is sent from the running user's email address through Salesforce's email infrastructure (respects org email deliverability settings).

toAddresses: one or more recipient email addresses
body / htmlBody: email body content (htmlBody takes precedence)
templateName: use an existing email template instead of providing body text
whatId: related record ID (e.g. Opportunity, Case) — links the email as an activity
whoId: Contact or Lead ID — links the email to the person record
saveAsActivity: saves the email as an EmailMessage activity (default: true)

Note: Salesforce email limits apply (daily email limits based on org edition). Mass emails should use list email features instead.

Input parameters:

- `body` (string): Plain text email body
- `ccAddresses` (array): CC email addresses
- `htmlBody` (string): HTML email body (takes precedence over body)
- `saveAsActivity` (boolean): Save email as an Activity record
- `subject` (string, required): Email subject line
- `templateName` (string): Email template API name (uses template instead of body)
- `toAddresses` (array, required): Recipient email addresses
- `useSignature` (boolean): Append running user's email signature
- `whatId` (string): Related record ID (e.g. Opportunity or Case ID)
- `whoId` (string): Contact or Lead ID

### `sf_export_records` (~161 tokens)

Export Records to CSV

Exports Salesforce records as CSV data using a SOQL query. Useful for data extraction, backup, or analysis.

soql: the SOQL query to run (SELECT fields FROM Object WHERE ...)
includeHeader: include column headers in the CSV output (default: true)
maxRecords: maximum records to export (default: 50000 — use Bulk API for larger datasets)

Returns the CSV content as a string. For very large exports (>50k records), use sf_bulk_import_records with operation='query' instead.

Input parameters:

- `format` (string): Export format: json or csv
- `includeHeaders` (boolean): Include CSV header row
- `limit` (integer): Maximum records to export
- `query` (string, required): Full SOQL query string

### `sf_upsert_record` (~184 tokens)

Upsert SObject Record

Creates or updates a Salesforce record using an External ID field for matching. If a record with the given external ID value exists, it is updated; otherwise a new record is created.

objectApiName: the SObject API name (e.g. 'Account', 'Contact')
externalIdField: the External ID field API name used for matching (e.g. 'Legacy_Id__c')
externalIdValue: the value to match on
fields: the field values to set on the record

Input parameters:

- `externalIdField` (string, required): External ID field API name, e.g. 'My_External_Id__c'
- `externalIdValue` (string, required): Value of the external ID to match on
- `fields` (object, required): Field key-value pairs to set/update
- `objectApiName` (string, required): SObject API name, e.g. 'Account'

### `sf_get_record` (~133 tokens)

Get SObject Record by ID

Retrieves a single Salesforce record by its 15 or 18 character record ID. Returns all or specified fields.

objectApiName: the SObject API name (e.g. 'Account', 'Opportunity')
recordId: the 15 or 18 character Salesforce record ID
fields: optional list of field API names to return (omit for all fields)

Input parameters:

- `fields` (array): Field API names to retrieve. Empty = all available fields
- `objectApiName` (string, required): SObject API name, e.g. 'Account'
- `recordId` (string, required): Record ID (15 or 18 characters)

### `sf_search_records` (~214 tokens)

Search Records (SOSL)

Searches across multiple Salesforce objects using SOSL (Salesforce Object Search Language). SOSL uses the search index and is faster than SOQL for cross-object text searches.

searchTerm: the text to search for
objects: array of objects to search with optional fields list, e.g. [{ objectName: 'Account', fields: ['Id', 'Name'] }, { objectName: 'Contact', fields: ['Id', 'Name', 'Email'] }]
searchGroup: where to search — ALL FIELDS (default), NAME FIELDS, EMAIL FIELDS, or PHONE FIELDS
limit: max records per object (default: 20, max: 200)

Input parameters:

- `limit` (integer): Maximum results per object
- `objectTypes` (array): Alias for objects: array of object API name strings
- `objects` (array): Objects to search across: strings or {objectName, fields} objects
- `searchTerm` (string, required): Search term (SOSL FIND clause value, no quotes needed)

### `sf_create_data_category` (~139 tokens)

Create Data Category Group

Creates a Data Category Group with categories for classifying Salesforce Knowledge articles, solutions, or cases. Data categories enable hierarchical content classification and visibility controls.

fullName: data category group API name
label: display label
objectUsage: object type to categorize (e.g. 'KnowledgeArticle')
categories: top-level categories with optional sub-categories

Input parameters:

- `categories` (array): Top-level categories
- `description` (string): Group description
- `fullName` (string, required): Data category group API name
- `label` (string, required): Group display label
- `objectUsage` (string): Object to categorize, e.g. 'KnowledgeArticle'

### `sf_bulk_insert_records` (~139 tokens)

Bulk Insert Records (Bulk API 2.0)

Inserts multiple records of the same object type asynchronously using Salesforce Bulk API 2.0. More efficient than individual REST calls for large volumes. Returns a job ID to track status.

objectApiName: Salesforce object API name
records: array of record objects with field:value pairs
externalIdField: if provided, performs an upsert on this external ID field instead of insert

Input parameters:

- `externalIdField` (string): External ID field for upsert (omit for insert)
- `objectApiName` (string, required): Object API name, e.g. 'Contact'
- `records` (array, required): Array of records to insert (field:value pairs)

### `sf_bulk_update_records` (~103 tokens)

Bulk Update Records (Bulk API 2.0)

Updates multiple records of the same object type asynchronously using Salesforce Bulk API 2.0. Each record must include its Salesforce Id field. Returns a job ID to track status.

objectApiName: Salesforce object API name
records: array of records — each must include 'Id' plus fields to update

Input parameters:

- `objectApiName` (string, required): Object API name, e.g. 'Contact'
- `records` (array, required): Array of records with Id field required

### `sf_bulk_delete_records` (~95 tokens)

Bulk Delete Records (Bulk API 2.0)

Deletes multiple records by ID asynchronously using Salesforce Bulk API 2.0. Returns a job ID to track status. Use with caution — deleted records go to the Recycle Bin.

objectApiName: Salesforce object API name
ids: array of Salesforce record IDs to delete

Input parameters:

- `ids` (array, required): Salesforce record IDs to delete
- `objectApiName` (string, required): Object API name, e.g. 'Lead'

### `sf_create_external_id_field` (~165 tokens)

Create External ID Field

Creates a custom field with externalId=true on a Salesforce object. External ID fields can be used for upsert operations and integration matching. The field is also automatically marked as unique.

objectName: object API name
fullName: field API name ending in __c
label: display label
type: field type (Text, Number, Email, or AutoNumber)
length: max length for Text fields

Input parameters:

- `description` (string): Field description
- `fullName` (string, required): Field API name ending in __c
- `label` (string, required): Field display label
- `length` (integer): Length for Text fields
- `objectName` (string, required): Object API name, e.g. 'Account'
- `type` (string, required): Field data type

### `sf_create_flexcard` (~305 tokens)

Create OmniStudio FlexCard

Creates an OmniStudio FlexCard (OmniUiCard metadata type). FlexCards display contextual data on Lightning pages and Experience Cloud sites.

A FlexCard defines:
\- A data source (SOQL query, DataRaptor, Integration Procedure, Apex, or None)
\- Fields to display from the data source
\- Actions the user can take (navigate, launch OmniScript, open URL, start Flow)
\- States (card variations based on data conditions)

The card is created in inactive state. Use sf_activate_flexcard to activate it after creation.

dataSourceType options:
\- SOQL: provide a dataSourceName with a SOQL query string
\- DataRaptor: provide the DataRaptor interface name
\- IntegrationProcedure: provide the Integration Procedure key (Type_SubType)
\- Apex: provide the Apex class name
\- None: no data source (static card)

Input parameters:

- `actions` (array): Card actions
- `cardName` (string, required): API name of the FlexCard (OmniUiCard)
- `dataSourceName` (string): SOQL query, DataRaptor name, or Integration Procedure name
- `dataSourceType` (string)
- `description` (string)
- `fields` (array): Fields to display on the card
- `label` (string, required): Human-readable label
- `objectApiName` (string): Primary SObject, e.g. 'Account'
- `states` (array): Conditional states

### `sf_update_flexcard` (~156 tokens)

Update OmniStudio FlexCard

Updates an existing OmniStudio FlexCard (OmniUiCard). Reads the current definition, merges the provided changes, and redeploys.

Provide only the fields you want to change. The card will be deactivated automatically if active — use sf_activate_flexcard to reactivate after the update.

All fields arrays (fields, actions, states) are replaced entirely if provided.

Input parameters:

- `actions` (array)
- `cardName` (string, required): API name of the FlexCard to update
- `dataSourceName` (string)
- `dataSourceType` (string)
- `description` (string)
- `fields` (array)
- `label` (string)
- `states` (array)

### `sf_activate_flexcard` (~76 tokens)

Activate OmniStudio FlexCard

Activates an OmniStudio FlexCard so it is visible on Lightning pages and Experience Cloud sites.

Reads the existing FlexCard definition and redeploys it with isActive=true. The card must already exist (created with sf_create_flexcard).

Input parameters:

- `cardName` (string, required): API name of the FlexCard to activate

### `sf_get_flexcard` (~51 tokens)

Get OmniStudio FlexCard

Retrieves the configuration of an OmniStudio FlexCard including its data source, fields, actions, states, and activation status.

Input parameters:

- `cardName` (string, required): API name of the FlexCard to retrieve

### `sf_create_omniscript` (~293 tokens)

Create OmniStudio OmniScript

Creates an OmniStudio OmniScript — a guided interaction flow for collecting data or performing processes.

OmniScripts are identified by Type + SubType + Language (e.g. AccountOpening / Personal / English). The fullName becomes Type_SubType_Language.

The script is created inactive with the specified elements. Complex element configuration (branching logic, custom LWC overrides, remote actions) should be finalized in the OmniScript Designer after creation.

isLwcEnabled: true deploys the script as a Lightning Web Component (recommended for performance).
isOmniScriptEmbeddable: true allows embedding this script inside other OmniScripts.

Use sf_activate_omniscript to activate after creation.

Input parameters:

- `description` (string)
- `elements` (array): Script elements; complex structures are set via the OmniScript designer
- `isLwcEnabled` (boolean): Use LWC runtime (recommended for new scripts)
- `isOmniScriptEmbeddable` (boolean): Allow embedding in OmniStudio cards
- `label` (string, required)
- `language` (string): Language label, default English
- `scriptName` (string): Ignored — fullName is derived from type_subType_language
- `subType` (string, required): OmniScript sub-type, e.g. 'Create', 'Edit'
- `type` (string, required): OmniScript type, e.g. 'Account', 'Claims'

### `sf_update_omniscript` (~146 tokens)

Update OmniStudio OmniScript

Updates an existing OmniScript's metadata properties (description, LWC mode, embeddable flag). Identified by Type + SubType + Language.

Note: OmniScript element/step editing is best done in the OmniScript Designer. This tool updates the container metadata only. The script will be deactivated if currently active — reactivate with sf_activate_omniscript.

Input parameters:

- `description` (string)
- `isLwcEnabled` (boolean)
- `isOmniScriptEmbeddable` (boolean)
- `language` (string)
- `subType` (string, required): OmniScript sub-type
- `type` (string, required): OmniScript type

### `sf_activate_omniscript` (~72 tokens)

Activate OmniStudio OmniScript

Activates an OmniScript so it can be launched from FlexCards, Experience Cloud, or standalone pages. Identified by Type + SubType + Language.

Input parameters:

- `language` (string)
- `subType` (string, required): OmniScript sub-type
- `type` (string, required): OmniScript type

### `sf_get_omniscript` (~70 tokens)

Get OmniStudio OmniScript

Retrieves the configuration of an OmniScript including its elements, activation status, and LWC settings. Identified by Type + SubType + Language.

Input parameters:

- `language` (string)
- `subType` (string, required): OmniScript sub-type
- `type` (string, required): OmniScript type

### `sf_create_dataraptor` (~278 tokens)

Create OmniStudio DataRaptor

Creates a DataRaptor interface for OmniStudio data transformation. DataRaptors handle Extract (read from Salesforce), Transform (convert data formats), and Load (write to Salesforce) operations.

interfaceType:
\- Extract: reads data from Salesforce objects using SOQL-like field mappings
\- Transform: converts/maps data between formats (JSON path transformations)
\- Load: writes data to Salesforce objects

Each field mapping defines:
\- sourceField: source JSON path or Salesforce field API name
\- targetField: target JSON path or Salesforce field API name
\- dataType: data type (Text, Number, Boolean, Date, etc.)
\- formula: optional transformation formula

filterCriteria: SOQL WHERE clause for Extract DataRaptors (e.g. "Id = ':AccountId'")

Input parameters:

- `dataRaptorName` (string, required): API name of the DataRaptor
- `description` (string)
- `fields` (array): Field mappings
- `filterCriteria` (string): SOQL WHERE clause for Extract, e.g. 'Id = :recordId'
- `interfaceType` (string, required): DataRaptor type: Extract reads from SF, Transform maps data, Load writes to SF
- `label` (string, required)
- `objectApiName` (string): Primary SObject for Extract or Load (e.g. 'Account')

### `sf_get_dataraptor` (~50 tokens)

Get OmniStudio DataRaptor

Retrieves the configuration of a DataRaptor interface including its type, field mappings, and filter criteria.

Input parameters:

- `dataRaptorName` (string, required): API name of the DataRaptor to retrieve

### `sf_create_integration_procedure` (~272 tokens)

Create OmniStudio Integration Procedure

Creates an OmniStudio Integration Procedure — a server-side process that orchestrates data integration without UI. Integration Procedures run in Apex context and can be invoked from OmniScripts, FlexCards, or APIs.

Integration Procedures use the OmniScript metadata type with omniProcessType=IntegrationProcedure. The fullName is ProcedureName_SubType.

Element types:
\- DataRaptor: call a DataRaptor for Salesforce CRUD
\- HTTPAction: call an external REST/SOAP API
\- Response: return data to the caller
\- Loop: iterate over a collection
\- Conditional: branch based on conditions
\- SetValues: set variables
\- ExceptionBlock: handle errors
\- Matrix: call a Calculation Matrix
\- OmniScript: call a nested OmniScript
\- Aggregate: combine multiple data sources

Set isActive: true to activate immediately after creation.

Input parameters:

- `description` (string)
- `elements` (array): Procedure elements (DataRaptor, HTTP calls, conditionals)
- `isActive` (boolean): Activate immediately after creation
- `label` (string, required)
- `procedureName` (string, required): Type portion of procedure key, e.g. 'Account'
- `subType` (string, required): Sub-type portion, e.g. 'GetDetails' — fullName = type_subType

### `sf_update_integration_procedure` (~112 tokens)

Update OmniStudio Integration Procedure

Updates an existing Integration Procedure's metadata (description, active status). Identified by procedureName + subType (fullName = procedureName_subType).

For element/step changes, use the OmniStudio Integration Procedure Designer. Set isActive: false to deactivate, then make changes, then sf_activate_integration_procedure.

Input parameters:

- `description` (string)
- `isActive` (boolean)
- `procedureName` (string, required): Type portion of procedure key
- `subType` (string, required)

### `sf_get_integration_procedure` (~51 tokens)

Get OmniStudio Integration Procedure

Retrieves the configuration of an Integration Procedure including its elements and activation status. Identified by procedureName + subType.

Input parameters:

- `procedureName` (string, required)
- `subType` (string, required)

### `sf_activate_integration_procedure` (~57 tokens)

Activate OmniStudio Integration Procedure

Activates an Integration Procedure so it can be invoked from OmniScripts, FlexCards, and APIs. Identified by procedureName + subType.

Input parameters:

- `procedureName` (string, required)
- `subType` (string, required)

### `sf_create_calculation_matrix` (~191 tokens)

Create OmniStudio Calculation Matrix

Creates a Calculation Matrix for rule-based lookups and calculations. Matrices map input combinations to output values — useful for pricing, eligibility, scoring, and decision tables.

inputVariables: list of input variable names (columns used for lookups)
outputVariables: list of output variable names (columns returned)
rows: array of { inputs: {var: value}, outputs: {var: value} } defining the lookup table

Example: a pricing matrix with inputs [ProductType, Region] and outputs [Price, Discount].

Input parameters:

- `description` (string)
- `inputVariables` (array, required): Input column definitions
- `label` (string, required)
- `matrixName` (string, required): API name of the Calculation Matrix
- `outputVariables` (array, required): Output column definitions
- `rows` (array): Matrix rows: array of {inputVarName: value, ..., outputVarName: value}

### `sf_create_calculation_procedure` (~167 tokens)

Create OmniStudio Calculation Procedure

Creates a Calculation Procedure that orchestrates multi-step calculations using Calculation Matrices, formulas, and logic steps.

steps array — each step has:
\- name: step identifier
\- type: MatrixLookup (call a matrix), Formula (expression), Condition (branch), Assignment (set variable)
\- matrixName: required for MatrixLookup steps
\- expression: required for Formula/Condition steps
\- inputMap: maps procedure variables to step inputs
\- outputMap: maps step outputs back to procedure variables

Use Calculation Procedures to build complex pricing engines, eligibility calculators, or multi-factor scoring systems.

Input parameters:

- `description` (string)
- `label` (string, required)
- `procedureName` (string, required): API name of the Calculation Procedure
- `steps` (array): Procedure steps

### `sf_export_omnistudio_component` (~167 tokens)

Export OmniStudio Component

Exports an OmniStudio component's metadata as a JSON string for backup, version control, or migration to another org.

componentType: FlexCard, OmniScript, DataRaptor, IntegrationProcedure, CalculationMatrix, or CalculationProcedure
componentName: the API name / fullName of the component to export (for OmniScript, use Type_SubType_Language format)

Returns the component metadata as a JSON-serialized XML string.

Input parameters:

- `componentName` (string, required): Component API name
- `componentType` (string, required): Component type to export
- `language` (string): Language (for OmniScript, e.g. 'English')
- `subType` (string): Sub-type (required for OmniScript and IntegrationProcedure: the subType portion of the fullName)

### `sf_import_omnistudio_component` (~170 tokens)

Import OmniStudio Component

Imports an OmniStudio component into the org from previously exported JSON (from sf_export_omnistudio_component). Optionally renames the component on import.

componentType: FlexCard, OmniScript, DataRaptor, IntegrationProcedure, CalculationMatrix, or CalculationProcedure
exportedJson: the JSON string returned by sf_export_omnistudio_component
newComponentName: optional new name/fullName for the imported component (useful when migrating to a different name)

Input parameters:

- `activate` (boolean): Activate the component after import
- `componentType` (string, required): Component type to import
- `jsonDefinition` (string, required): JSON string exported by sf_export_omnistudio_component
- `newName` (string, required): New API name for the imported component (must differ from source)

### `sf_create_document_generation` (~217 tokens)

Create OmniStudio Document Generation Template

Creates an OmniStudio Document Generation configuration (OmniDocumentGenerationConfig metadata type) that links a document template to a data source for automated document creation.

templateName: unique API name for the document generation config
label: display label
objectApiName: the Salesforce object this template generates documents for
templateType: Word, PDF, or Excel (default: Word)
dataSourceType: DataRaptor or IntegrationProcedure (default: DataRaptor)
dataSourceName: API name of the DataRaptor or Integration Procedure to use for data
description: optional description

Input parameters:

- `dataSourceName` (string, required): DataRaptor or Integration Procedure API name to feed data
- `dataSourceType` (string): Data source type
- `description` (string): Template description
- `label` (string, required): Template display label
- `objectApiName` (string, required): Context object API name, e.g. 'Account'
- `templateName` (string, required): Template API name
- `templateType` (string): Output document format

### `sf_create_service_channel` (~193 tokens)

Create OmniChannel Service Channel

Creates an OmniChannel Service Channel that connects work items from a Salesforce object to the OmniChannel routing engine.

channelType options: Case, Chat, Messaging, Voice, Email, SocialPost, Custom

relatedObjectApiName: the Salesforce object this channel routes (e.g. "Case", "LiveChatTranscript", "MessagingSession"). Required for Custom type.

capacity: maximum number of simultaneous work items an agent can handle on this channel (default 1).

Service Channels are referenced by Routing Configurations and Presence Configurations.

Input parameters:

- `capacity` (integer): Capacity weight for this channel
- `channelName` (string, required): API name / DeveloperName of the Service Channel
- `channelType` (string)
- `label` (string, required)
- `relatedObject` (string): Alias for relatedObjectApiName
- `relatedObjectApiName` (string): SObject routed via this channel, default 'Case'

### `sf_create_routing_configuration` (~261 tokens)

Create OmniChannel Routing Configuration

Creates a Routing Configuration that defines how work items are assigned to agents.

routingModel options:
\- LeastActive: routes to the agent with the fewest active work items
\- MostAvailable: routes to the agent with the most available capacity
\- ExternalRouting: custom routing via Apex or external system

capacity: agent capacity consumed per work item (1–100)
priority: routing priority (lower number = higher priority, range 1–10)
unitType: Percentage or Throughput (how capacity is measured)
pushTimeout: seconds before a declined/unanswered item is re-queued (optional)

After creating, link it to a queue with sf_create_queue_routing_config.

Input parameters:

- `capacity` (number): Capacity percentage or item count
- `configName` (string): API name of the RoutingConfiguration
- `description` (string)
- `label` (string, required)
- `priority` (integer): Routing priority (lower number = higher priority)
- `pushTimeout` (integer): Seconds before push routing times out (0 = no timeout)
- `routingConfigName` (string): Alias for configName
- `routingModel` (string)
- `routingPriority` (integer): Alias for priority
- `unitType` (string)

### `sf_create_queue_routing_config` (~137 tokens)

Link Routing Configuration to Queue

Associates a Routing Configuration with an existing Queue, enabling OmniChannel routing for that queue.

After creating a Routing Configuration (sf_create_routing_configuration), use this tool to link it to the Queue that holds the work items. Work items assigned to the queue will then be routed to agents using the specified routing model.

queueDeveloperName: the API name of the Queue (DeveloperName, not label)
routingConfigName: the API name of the Routing Configuration to link

Input parameters:

- `queueDeveloperName` (string, required): DeveloperName of the existing queue
- `routingConfigName` (string, required): API name of the RoutingConfiguration to link

### `sf_create_presence_configuration` (~148 tokens)

Create OmniChannel Presence Configuration

Creates a Presence Configuration (PresenceUserConfig) that controls which Service Channels agents can handle and their total work capacity.

capacity: total capacity units available to agents with this configuration
serviceChannels: list of Service Channel API names the agents can work on
allowAgentsToChangeStatus: whether agents can manually change their presence status

Assign this configuration to agents via their Profile or Permission Set.

Input parameters:

- `allowAgentsToChangeStatus` (boolean)
- `capacity` (integer): Maximum concurrent work items per agent
- `configName` (string, required): API name of the PresenceUserConfig
- `description` (string)
- `label` (string, required)
- `serviceChannels` (array)

### `sf_create_presence_status` (~132 tokens)

Create OmniChannel Presence Status

Creates a Presence Status that agents can set to indicate their availability.

statusType:
\- Online: agent is available for all assigned channels
\- Busy: agent is limited to specific channels
\- Offline: agent receives no work items

serviceChannels: for Busy status, list which channels remain active.

After creating, assign the status to profiles/permission sets with sf_assign_presence_status.

Input parameters:

- `label` (string, required)
- `serviceChannels` (array): ServiceChannel API names to associate
- `statusName` (string, required): API name / DeveloperName of the Presence Status
- `statusType` (string)

### `sf_assign_presence_status` (~124 tokens)

Assign Presence Status to Profiles/Permission Sets

Grants access to a Presence Status for the specified Profiles and/or Permission Sets. Agents can only select presence statuses that are assigned to their profile or permission set.

profiles: list of Profile names (e.g. ["Standard User", "Service Agent"])
permissionSets: list of Permission Set API names

Either profiles or permissionSets must be provided (or both).

Input parameters:

- `permissionSets` (array): Permission Set API names to grant access
- `profiles` (array): Profile API names to grant access
- `statusName` (string, required): API name of the ServicePresenceStatus

### `sf_create_skill` (~101 tokens)

Create OmniChannel / Field Service Skill

Creates a Skill that can be assigned to service agents. Skills are used for:
\- OmniChannel skill-based routing (route work to agents with required skills)
\- Field Service Lightning (assign skills to resources, skills to work types)

After creating a skill, assign it to agents with sf_assign_skill_to_agent.

Input parameters:

- `description` (string)
- `label` (string, required)
- `skillName` (string, required): DeveloperName / API name of the skill

### `sf_assign_skill_to_agent` (~164 tokens)

Assign Skill to Service Agent

Assigns a Skill to a Salesforce user (service agent) with a skill level rating. Creates a ServiceResource for the user if one does not already exist, then creates a ServiceResourceSkill record.

skillName: the API name (DeveloperName) of the skill to assign
username: the Salesforce username (e.g. agent@example.com) or user ID
skillLevel: proficiency level from 0 to 10 (default 5)

ServiceResource is the Field Service / OmniChannel representation of a user as a workable resource.

Input parameters:

- `skillLevel` (number): Proficiency level 0 (novice) to 10 (expert)
- `skillName` (string, required): Skill DeveloperName
- `username` (string, required): Salesforce username of the service agent

### `sf_create_service_territory` (~169 tokens)

Create Field Service Service Territory

Creates a Service Territory for Field Service Lightning. Territories define the geographic areas or organizational divisions where field service resources operate.

isActive: set true to make the territory immediately available for scheduling
operatingHoursName: API name of an existing OperatingHours record to set business hours
Address fields (street, city, state, country, postalCode): optional location for the territory center

Input parameters:

- `city` (string)
- `country` (string)
- `isActive` (boolean)
- `label` (string, required)
- `operatingHoursName` (string): Name of the OperatingHours record to link
- `postalCode` (string)
- `state` (string)
- `street` (string)
- `territoryName` (string, required): Name of the Service Territory

### `sf_create_work_type` (~208 tokens)

Create Field Service Work Type

Creates a Work Type that defines a category of field service job. Work Types set default durations, block times, and skill requirements for work orders.

estimatedDuration: expected time to complete the work
durationType: Minutes, Hours, or Days
blockTimeBeforeWork: travel/prep time before the appointment
blockTimeAfterWork: cleanup/travel time after the appointment
skillRequirements: array of { skillName, skillLevel } — skills required on the resource to perform this work type

Input parameters:

- `blockTimeAfterWork` (number): Buffer time after work in minutes
- `blockTimeBeforeWork` (number): Buffer time before work in minutes
- `description` (string)
- `durationType` (string)
- `estimatedDuration` (number, required): Estimated work duration value
- `label` (string, required): Display label (used as Name field)
- `skillRequirements` (array): Required Skill DeveloperNames
- `workTypeName` (string, required): Name of the Work Type

### `sf_create_messaging_channel` (~272 tokens)

Create Messaging Channel

Creates a Messaging Channel for Salesforce digital engagement (SMS, WhatsApp, Facebook Messenger, Apple Messages for Business, etc.).

channelType options: SMS, WhatsApp, Facebook, AppleBusinessChat, Line, GoogleBusinessMessages, EinsteinBotChannel, WebChat

phoneNumber: E.164 format phone number for SMS/WhatsApp channels (e.g. +15551234567)
pageId: Facebook Page ID or equivalent external platform identifier

routingType: Queue (route to a queue) or Bot (route to an Einstein Bot first)
queueName: required when routingType=Queue
botName: required when routingType=Bot (bot handles initial messages)

After creating, configure the channel with sf_create_embedded_service to add it to a site.

Input parameters:

- `botName` (string): Bot API name for bot-first routing
- `channelName` (string, required): API name / MasterLabel for the Messaging Channel
- `channelType` (string, required)
- `description` (string)
- `label` (string, required)
- `pageId` (string): Facebook Page ID for Facebook Messenger
- `phoneNumber` (string): Phone number for SMS/WhatsApp channels
- `queueName` (string): Queue DeveloperName to route work items to
- `routingType` (string)

### `sf_create_chat_button` (~291 tokens)

Create Live Agent Chat Button

Creates a Live Chat button (LiveChatButton) that can be embedded on websites to start chat sessions with agents.

routingType: Choice (skills-based) or Queue (queue-based routing)
queueName: the Queue to route chats to (for Queue routing)
botName: an Einstein Bot to handle chats initially (optional)
windowLanguage: display language for the chat window (e.g. "en_US", "fr", "de")
inviteRenderer: name of a custom Visualforce page for chat invitations
customAgentName: agent display name shown to website visitors
optionsHasTimeoutAlert: show alert if no agent available within timeout period

After creating, embed the chat button on a site with sf_create_embedded_service.

Input parameters:

- `botName` (string): Bot name for bot-first routing
- `buttonName` (string, required): API name / DeveloperName of the chat button
- `customAgentName` (string): Agent display name shown in chat window
- `description` (string)
- `inviteRenderer` (string): Custom invite Visualforce page/LWC component name
- `label` (string, required)
- `optionsHasTimeoutAlert` (boolean)
- `queueName` (string): Queue DeveloperName for queue-based routing
- `routingType` (string)
- `windowLanguage` (string): Chat window language code, e.g. 'en', 'fr', 'de'

### `sf_create_embedded_service` (~324 tokens)

Create Embedded Service Deployment

Creates an Embedded Service deployment (EmbeddedServiceConfig) that bundles a chat button or messaging channel into a web snippet for embedding on websites or Experience Cloud sites.

channelType: Chat (uses a LiveChatButton) or Messaging (uses a MessagingChannel)
chatButtonName: required for Chat type — the LiveChatButton API name
messagingChannelName: required for Messaging type — the MessagingChannel API name
site: the Experience Cloud site or Salesforce Site API name to associate with

Branding:
\- primaryColor: main brand color (hex, e.g. "#0070D2")
\- secondaryColor: secondary/header color
\- fontName: web font name (e.g. "Salesforce Sans")

After creation, get the deployment code snippet from Setup → Embedded Service Deployments.

Input parameters:

- `channelType` (string)
- `chatButtonName` (string): LiveChatButton API name (for LiveAgent)
- `deploymentName` (string): API name of the Embedded Service deployment
- `description` (string)
- `fontName` (string): Font family name, e.g. 'Salesforce Sans'
- `label` (string, required)
- `messagingChannelName` (string): MessagingChannel API name (for MessagingChannel)
- `primaryColor` (string): Primary brand color hex, e.g. '#0070D2'
- `secondaryColor` (string): Secondary color hex
- `serviceName` (string): Alias for deploymentName
- `site` (string, required): Experience Cloud site name or 'none' for non-community deployment

### `sf_create_bot_routing` (~216 tokens)

Configure Bot Escalation Routing

Configures an Einstein Bot to transfer conversations to a human agent queue when escalation conditions are met. Updates the BotVersion with a Transfer dialog.

botName: the Bot API name (DeveloperName)
transferToQueueName: the Queue API name to transfer escalated conversations to
transferMessage: message shown to the customer during transfer (default: "Connecting you to an agent...")
escalationConditions: array of { trigger, action } pairs. Triggers: agentRequested, noResponse, fallback. Actions: TransferToQueue.

This tool finds the latest BotVersion for the specified bot and adds the transfer dialog. The bot must already exist (created via Setup or sf_create_agent).

Input parameters:

- `botName` (string, required): Einstein Bot API name (DeveloperName of the BotVersion parent)
- `escalationConditions` (array): Conditions that trigger transfer to human agent
- `transferMessage` (string): Message shown to customer when transferring to agent
- `transferToQueueName` (string, required): Queue DeveloperName to transfer conversation to

### `sf_get_setup_audit_trail` (~223 tokens)

Get Setup Audit Trail

Queries the SetupAuditTrail object to see who made what configuration changes to the org, and when. Covers the last 6 months of setup activity.

Returns records with: date, username, section, action, display (human-readable description)

section filter examples: 'Custom Fields', 'Profiles', 'Flows', 'Apex Classes', 'Permission Sets', 'Connected Apps', 'Users'

Useful for:
\- Security audits (who changed profiles or permissions)
\- Debugging unexpected configuration changes
\- Compliance reporting on org configuration changes

Input parameters:

- `createdByUsername` (string): Filter by the username who made the change
- `endDate` (string): End date in ISO format, e.g. '2025-12-31'
- `limit` (integer): Maximum records to return
- `section` (string): Filter by section, e.g. 'Custom Fields', 'Profiles', 'Flows', 'Apex Classes'
- `startDate` (string): Start date in ISO format, e.g. '2025-01-01'

### `sf_get_login_history` (~231 tokens)

Get Login History

Queries LoginHistory to see user login activity — who logged in, from where, and whether they succeeded.

Returns records with: loginTime, username, sourceIp, browser, platform, status, loginType

status values: 'Success', 'Failed', 'No Password', 'Blocked', 'No Cookie'
loginType values: 'Application', 'API', 'SAML', 'OAuth', 'LightningLogin', 'Chatter'

Useful for:
\- Security monitoring (failed logins, unusual IP addresses)
\- Compliance auditing (who accessed the org and when)
\- Investigating suspicious account activity

Note: LoginHistory covers the past 6 months.

Input parameters:

- `endDate` (string): End date in ISO format, e.g. '2025-12-31'
- `limit` (integer): Maximum records to return
- `startDate` (string): Start date in ISO format, e.g. '2025-01-01'
- `status` (string): Filter by login status, e.g. 'Success', 'Failed'
- `username` (string): Filter by Salesforce username

### `sf_get_event_logs` (~254 tokens)

Get Event Log Files

Queries EventLogFile for detailed activity logs. Event logs capture granular org activity for security monitoring and performance analysis.

Common eventType values:
\- Login — login attempts and results
\- API — SOAP/REST API calls
\- Report — report executions
\- Flow — Flow runs and executions
\- ApexExecution — Apex code executions
\- LightningPageView — Lightning page views
\- RestApi — REST API requests
\- VisualforceRequest — Visualforce page requests
\- URI — general HTTP requests
\- LightningError — Lightning component errors

Returns parsed CSV log entries (up to 20 rows per log file, up to 3 files per call).

Requires Event Monitoring add-on OR Agentforce debug logs to be enabled.

Input parameters:

- `endDate` (string): End date in ISO format, e.g. '2025-12-31'
- `eventType` (string, required): Event type, e.g. 'Login', 'API', 'Report', 'Flow', 'ApexExecution', 'LightningPageView', 'RestApi'
- `limit` (integer): Maximum log files to fetch
- `startDate` (string): Start date in ISO format, e.g. '2025-01-01'

### `sf_get_field_history` (~221 tokens)

Get Field History for a Record

Queries the {Object}History object to retrieve a field-level change history for a specific record. Shows what changed, when, the old and new values, and who made the change.

Returns records with: date, field, oldValue, newValue, changedBy

objectApiName: the SObject with history tracking enabled, e.g. 'Account', 'Opportunity', 'Case'
recordId: the specific record to retrieve history for

Note: Field history tracking must be enabled for the object and for each field you want to track (Setup → Object Manager → {Object} → Fields & Relationships → Field History Tracking). History is retained for up to 18 months.

Input parameters:

- `fields` (array): Optional field names to filter — returns all tracked fields if omitted
- `limit` (integer): Maximum history records to return
- `objectApiName` (string, required): Object API name, e.g. 'Account', 'Case', 'Opportunity'
- `recordId` (string, required): Record ID to fetch history for (15 or 18 characters)

### `sf_create_einstein_prediction` (~419 tokens)

Create Einstein Prediction (ML Prediction Definition)

Creates an Einstein Prediction Builder prediction definition (MLPredictionDefinition metadata type). Predictions analyze historical Salesforce data to score or classify records automatically.

predictionType:
\- BinaryClassification: predict a yes/no outcome (e.g. Will this opportunity close? Is this lead likely to convert?)
\- Regression: predict a numeric value (e.g. Expected revenue, likelihood score)

targetField: the field the prediction is based on (e.g. 'IsWon' for BinaryClassification on Opportunity)
pushbackField: an existing custom field to write the prediction score to automatically

IMPORTANT: Einstein Prediction Builder requires an Einstein Analytics license or the Einstein Platform add-on. If the org lacks this license, the metadata deployment will succeed but the prediction cannot be trained or activated. This tool creates the definition — training happens in Setup → Einstein → Prediction Builder.

The prediction is created in Draft status. Activate it from Setup after training is complete.

Input parameters:

- `aiApplicationDeveloperName` (string, required): REQUIRED by Salesforce. API name of an existing AIApplication that owns this prediction — Einstein Prediction Builder creates one per app. The deploy fails with 'Required field is missing: aiApplicat…
- `description` (string): Prediction description
- `label` (string, required): Prediction display label
- `negativeLabel` (string): Label for negative outcome (BinaryClassification only)
- `objectApiName` (string): Salesforce object to run predictions on, e.g. 'Opportunity'
- `objectName` (string): Alias for objectApiName
- `positiveLabel` (string): Label for positive outcome (BinaryClassification only)
- `predictionName` (string, required): Prediction API name
- `predictionType` (string, required): BinaryClassification/Classification for yes/no, Regression for numeric
- `pushbackField` (string): Field to write the prediction score to, e.g. 'Win_Score__c'
- `targetField` (string, required): Field API name to predict, e.g. 'IsWon'. Deployed as <predictionField> together with objectApiName.

### `sf_create_next_best_action` (~221 tokens)

Create Next Best Action Strategy

Creates a Next Best Action (NBA) recommendation strategy (RecommendationStrategy metadata type). NBA strategies surface contextual recommendations to agents and customers on record pages, communities, and chatbots.

A strategy defines:
\- contextObjectApiName: the record type that provides context (e.g. 'Account', 'Case', 'Opportunity')
\- recommendations: a list of actions the agent can offer, each with Accept/Decline buttons and an optional Flow to execute on acceptance

NBA strategies can be displayed via:
\- Einstein Next Best Action component on a Lightning Record Page
\- OmniScripts and FlexCards
\- Service Console

After creating, add the "Einstein Next Best Action" Lightning component to a record page and configure it to use this strategy.

Input parameters:

- `contextObjectApiName` (string): Object that provides context, e.g. 'Account', 'Case'
- `description` (string): Strategy description
- `label` (string, required): Strategy display label
- `recommendations` (array): Recommendation definitions
- `strategyName` (string, required): Strategy API name

### `sf_create_einstein_bot` (~276 tokens)

Create Einstein Bot (Classic)

Creates a classic Einstein Bot (Bot + BotVersion metadata types) with one or more conversation dialogs. Classic Einstein Bots handle chat and messaging channels via rule-based and ML-powered conversation flows.

Note: For AI-first agents using large language models, use sf_create_agent (Agentforce/Einstein Service Agent) instead. Classic Einstein Bots are best suited for:
\- Structured FAQ automation
\- Simple data collection workflows
\- Channels that don't support Agentforce (SMS, WhatsApp via classic routing)

Each dialog defines:
\- name/label: the dialog identifier
\- utterances: training phrases that trigger this dialog
\- messages: bot responses shown to the user
\- type: Main (user-facing), System (internal), Rule (condition-based)

The bot is created with an ML domain for intent classification. After creation:
1\. Train the bot in Setup → Einstein Bots → {BotName} → Train
2\. Activate the bot
3\. Connect it to a messaging channel or chat button

Input parameters:

- `botName` (string, required): Bot API name
- `defaultLocale` (string): Default language/locale, e.g. 'en_US', 'fr', 'de'
- `description` (string): Bot description
- `dialogs` (array): Bot dialogs
- `label` (string, required): Bot display label

### `sf_create_user_role_hierarchy` (~230 tokens)

Create User Role Hierarchy

Creates a new UserRole in the Salesforce Role Hierarchy. Roles control record visibility — users in higher roles can see records owned by users in lower roles (depending on OWD). Optionally set a parentRoleName to place this role beneath an existing role.

roleName: API name for the role (no spaces, used as DeveloperName)
label: display name shown in Setup
parentRoleName: API name of the parent role (omit for a top-level role)
description: optional description

Input parameters:

- `accountAccessLevel` (string): Account access for subordinates
- `caseAccessLevel` (string): Case access for subordinates
- `contactAccessLevel` (string): Contact access for subordinates
- `description` (string): Role description
- `label` (string, required): Role display label
- `mayForecastManagerShare` (boolean): Grant manager forecast sharing
- `opportunityAccessLevel` (string): Opportunity access for subordinates
- `parentRoleName` (string): Parent role API name (omit for top-level)
- `roleName` (string, required): Role API name

### `sf_reset_user_password` (~107 tokens)

Reset User Password

Resets a Salesforce user's password by username or user ID. Sends a password-reset email to the user's email address. Use when a user is locked out or needs to set a new password.

username or userId: identify the user (at least one required)
sendEmail: set false to reset without sending an email (default: true)

Input parameters:

- `sendEmail` (boolean): Send password reset email to the user
- `username` (string, required): Salesforce username of the user to reset

### `sf_freeze_user` (~97 tokens)

Freeze or Unfreeze User

Freezes or unfreezes a Salesforce user account. A frozen user cannot log in but the license is retained (unlike deactivation). Useful for temporarily blocking access without losing data ownership.

username or userId: identify the user
freeze: true to freeze, false to unfreeze

Input parameters:

- `freeze` (boolean, required): true to freeze, false to unfreeze
- `username` (string, required): Salesforce username to freeze or unfreeze

### `sf_create_territory` (~204 tokens)

Create Enterprise Territory Management Territory

Creates a Territory in Enterprise Territory Management (ETM). Territories define logical sales regions or account groupings. Requires ETM to be enabled in the org.

territoryName: API name (DeveloperName) of the territory
label: display name
territoryType: DeveloperName of the Territory2Type (e.g. 'Geographic', 'Named_Account')
parentTerritoryName: optional parent territory DeveloperName for hierarchical nesting
description: optional description

Input parameters:

- `accountAccessLevel` (string): Account access for territory members
- `caseAccessLevel` (string): Case access
- `description` (string): Territory description
- `label` (string, required): Territory display label
- `opportunityAccessLevel` (string): Opportunity access
- `parentTerritoryName` (string|null): Parent territory name for hierarchy
- `territoryName` (string, required): Territory API name
- `territoryType` (string): Territory2Type API name (must exist in org)

### `sf_assign_territory_to_user` (~129 tokens)

Assign Territory to User

Assigns a user to an Enterprise Territory Management territory via the UserTerritory2Association SObject. Users assigned to a territory get visibility into accounts in that territory.

username or userId: identify the user
territoryName: DeveloperName of the Territory2 to assign
roleInTerritory: optional role — 'Salesperson', 'Manager', or 'BusinessUser'

Input parameters:

- `roleInTerritory` (string): User role within the territory
- `territoryName` (string, required): Territory API name to assign user to
- `username` (string, required): Salesforce username to assign

### `sf_create_forecast_hierarchy` (~137 tokens)

Create Forecast Hierarchy Configuration

Configures a Collaborative Forecasting hierarchy entry by assigning a user as a forecast manager for another user. Forecast managers can view and adjust forecasts for their reports.

managerUsername: username of the forecast manager
reporteeUsername: username of the user being managed
forecastingType: the forecasting type DeveloperName (e.g. 'OpportunityRevenue')

Input parameters:

- `displayCurrency` (string): Currency code for display (e.g. 'USD', 'EUR')
- `forecastingType` (string): Forecasting type
- `isActive` (boolean): Enable this forecasting type
- `roleName` (string): Role name (informational)

### `sf_create_search_layout` (~202 tokens)

Create Search Layout

Creates or updates a SearchLayout for a Salesforce object, defining which fields appear in search results, lookup dialogs, and lookup filter fields. Use to customize what columns users see when they search for records or open a lookup dialog.

objectName: the API name of the object, e.g. 'Account' or 'Invoice__c'
searchResultsAdditionalFields: field API names to show as columns in global search results
lookupDialogsAdditionalFields: field API names to show in lookup dialog results
lookupFilterFields: field API names used as filterable columns in lookups

Input parameters:

- `lookupDialogsAdditionalFields` (array): Field API names to show in lookup dialogs
- `lookupFilterFields` (array): Field API names used as filter fields in lookup
- `objectName` (string, required): Object API name, e.g. 'Account' or 'Invoice__c'
- `searchResultsAdditionalFields` (array): Field API names to show in search results

### `sf_assign_layout_to_record_type` (~181 tokens)

Assign Layout to Record Type

Assigns an existing page layout to a specific record type on an object by updating the Profile metadata. Controls which page layout users see when viewing records of a given record type.

objectName: the API name of the object
recordTypeName: developer name of the record type
layoutName: full name of the page layout, e.g. 'Account Layout'
profileNames: optional list of profile names to update (defaults to Admin profile)

Input parameters:

- `layoutName` (string, required): Full name of the page layout, e.g. 'Account Layout'
- `objectName` (string, required): Object API name, e.g. 'Account' or 'Case'
- `profileNames` (array): Profile names to assign this layout for (optional)
- `recordTypeName` (string, required): Developer name of the record type, e.g. 'Enterprise'

### `sf_create_custom_tab` (~213 tokens)

Create Custom Web Tab

Creates a Custom Web Tab (URL-based tab) that opens an external URL or web page within the Salesforce UI. Different from sf_create_tab which creates object-based tabs. Use when you need a navigation item that points to an external website, an internal Visualforce page by URL, or a custom web app.

fullName: API name for the tab (no spaces, e.g. 'My_Web_Tab')
label: display label shown in the tab bar
url: the URL the tab points to, e.g. 'https://example.com'
description: optional description
hasSidebar: whether to show the Salesforce sidebar alongside the tab content

Input parameters:

- `description` (string): Tab description
- `fullName` (string, required): Tab API name, e.g. 'My_Web_Tab'
- `hasSidebar` (boolean): Whether the tab shows the Salesforce sidebar
- `label` (string, required): Tab display label
- `url` (string, required): URL the tab points to, e.g. 'https://example.com'

### `sf_get_org_limits` (~134 tokens)

Get Org Limits and Usage

Retrieves current API and governor limit usage for the org via the Salesforce Limits REST API. Returns all limits with their current usage and maximum allowed values.

Useful for:
\- Checking API call usage before running bulk operations
\- Monitoring storage (data/file) usage
\- Checking concurrent Apex job limits
\- Reviewing email delivery limits
\- Auditing active sessions

Returns an array of { name, remaining, max, percentUsed } sorted by percent used (most consumed first).

Input parameters:

- `filter` (string): Optional filter string — return only limits whose name contains this text (e.g. 'Api', 'Storage', 'Scratch')

### `sf_get_flow_errors` (~164 tokens)

Get Flow Errors and Fault Logs

Retrieves Flow interview fault records from the FlowRecordRelation and FlowInterview objects. Shows flows that have errored in runtime with their fault message and the record that triggered the error.

flowApiName: filter to a specific flow API name (optional — returns errors for all flows if omitted)
lookbackHours: how many hours back to search (default: 24, max: 168)
limit: maximum records to return (default: 50)

Returns: flow name, start time, error message, and related record ID for each fault.

Input parameters:

- `flowApiName` (string): Filter to a specific flow API name (optional)
- `hoursBack` (integer): Look back this many hours for errors
- `limit` (integer): Maximum error records to return

### `sf_get_apex_test_results` (~182 tokens)

Get Apex Test Results

Retrieves Apex test results from the most recent test runs via the Tooling API. Returns pass/fail status, error messages, stack traces, and code coverage for each test method.

className: filter to a specific test class name (optional)
outcome: filter by outcome — 'Pass', 'Fail', 'Skip', or omit for all
limit: maximum results to return (default: 100)

Returns: class name, method name, outcome, run time (ms), error message, and stack trace for failures.

Input parameters:

- `className` (string): Filter to a specific Apex test class
- `limit` (integer): Maximum results to return
- `outcomeFilter` (string): Filter by outcome
- `testRunId` (string): Specific test run ID (from sf_run_apex_tests). Omit to get latest run.

### `sf_get_deployment_history` (~132 tokens)

Get Deployment History

Retrieves the history of recent metadata deployments using the Tooling API DeployRequest object. Shows deployment status, component counts, test results, and error messages.

limit: number of recent deployments to return (default: 20, max: 200)
status: filter by status — 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Pending', or omit for all

Returns: deploy ID, status, start time, end time, component totals, test totals, and any errors.

Input parameters:

- `limit` (integer): Maximum deployments to return
- `status` (string): Filter by deployment status

### `sf_enable_debug_logs` (~236 tokens)

Enable Debug Logs for a User

Turns on Apex debug logging for a user by creating a DebugLevel and TraceFlag via the Tooling API. Required before sf_get_debug_logs will return anything new — Salesforce does not log activity unless a trace flag is active for that user.

username: username of the user to trace, e.g. 'ajay@example.com'
durationMinutes: how long tracing stays active (default 30, max 1440)
debugLevel: Apex code log granularity — FINEST (most verbose, recommended for debugging) down to ERROR

After enabling, have the user (or an automated process) perform the action you want to debug, then call sf_get_debug_logs to list the resulting logs and sf_get_debug_log_body to read one.

Input parameters:

- `debugLevel` (string): Apex code log granularity for the debug level (applies to ApexCode category; other categories default to a matching verbosity)
- `durationMinutes` (integer): How long the trace flag stays active, in minutes (max 24 hours)
- `username` (string, required): Username of the user to trace, e.g. 'ajay@example.com'

### `sf_get_debug_logs` (~192 tokens)

List Debug Logs

Lists recent Apex debug logs (ApexLog records) via the Tooling API. Use sf_enable_debug_logs first if no logs are showing up — Salesforce only logs activity for users with an active trace flag.

username: filter to logs generated by this username (optional)
operation: filter by operation substring, e.g. 'execute_anonymous_apex' (optional)
limit: maximum log entries to return (default 10, max 100)

Returns log metadata (ID, start time, duration, status, operation) but not the log content — pass a logId to sf_get_debug_log_body to read the full log.

Input parameters:

- `limit` (integer): Maximum number of log entries to return
- `operation` (string): Filter by operation substring, e.g. 'execute_anonymous_apex'
- `username` (string): Filter logs to this username (omit to list logs from all users)

### `sf_get_debug_log_body` (~78 tokens)

Get Debug Log Body

Retrieves the full text content of a single Apex debug log by ID. Get the logId from sf_get_debug_logs first. Logs are retained by Salesforce for 24 hours only.

Input parameters:

- `logId` (string, required): ApexLog record ID from sf_get_debug_logs (15 or 18 chars). Logs are retained for 24 hours.

### `sf_create_letterhead` (~170 tokens)

Create Email Letterhead

Creates a Letterhead that provides a consistent visual wrapper for HTML email templates. Letterheads define header, body, and footer colors and can be referenced by email templates to ensure brand consistency across automated emails.

fullName: letterhead API name
name: display name
backgroundColor: page background color hex, e.g. '#FFFFFF'
bodyColor: body area background color hex
headerColor: header section background color hex
description: optional description

Input parameters:

- `backgroundColor` (string): Background color hex, e.g. '#FFFFFF'
- `bodyColor` (string): Body background color hex
- `description` (string): Description
- `fullName` (string, required): Letterhead API name
- `headerColor` (string): Header background color hex
- `name` (string, required): Display name

### `sf_create_notification_type` (~136 tokens)

Create Custom Notification Type

Creates a Custom Notification Type for sending in-app and mobile push notifications. Custom notification types can be triggered from Flows, Apex, or Process Builder. Users receive notifications in the Salesforce Bell icon (desktop) and on the Salesforce mobile app.

fullName: notification type API name
masterLabel: display label
customNotifTypeName: developer name for the notification type
description: optional description

Input parameters:

- `customNotifTypeName` (string, required): Developer name for the notification type
- `description` (string): Description
- `fullName` (string, required): Custom notification type API name
- `masterLabel` (string, required): Master label

### `sf_create_scratch_org` (~148 tokens)

Create Scratch Org

Creates a Salesforce scratch org using the SF CLI. Scratch orgs are temporary, configurable environments for development and testing. Requires a Dev Hub org to be authorized.

definitionFile: path to project-scratch-def.json (optional, defaults to CLI default)
alias: alias for the scratch org
duration: number of days before expiry (1–30)
devHubAlias: Dev Hub org alias

Input parameters:

- `alias` (string): Alias for the scratch org
- `definitionFile` (string): Path to project-scratch-def.json (optional)
- `devHubAlias` (string): Dev Hub org alias
- `duration` (integer): Scratch org duration in days (1-30)

### `sf_delete_scratch_org` (~90 tokens)

Delete Scratch Org

Deletes a Salesforce scratch org by alias. This permanently removes the org and all its data. Use when finished with development or testing to free up scratch org allocations.

alias: alias of the scratch org to delete
noPrompt: skip the confirmation prompt (default: true)

Input parameters:

- `alias` (string, required): Alias of the scratch org to delete
- `noPrompt` (boolean): Skip confirmation prompt

### `sf_create_package` (~161 tokens)

Create Second-Generation Package

Creates a second-generation managed or unlocked package using the SF CLI. Packages bundle metadata for distribution. Managed packages support namespacing and AppExchange listing; unlocked packages support source-tracking without namespacing.

name: package name
packageType: Managed or Unlocked
path: source path for the package, e.g. 'force-app'
description: optional description
noNamespace: create without a namespace (Unlocked packages only)

Input parameters:

- `description` (string): Package description
- `name` (string, required): Package name
- `noNamespace` (boolean): Create without a namespace (Unlocked only)
- `packageType` (string, required): Package type: Managed or Unlocked
- `path` (string, required): Path to package source, e.g. 'force-app'

### `sf_create_package_version` (~162 tokens)

Create Package Version

Creates a new version of an existing second-generation package. Each version captures the current state of the package source. Package versions can be promoted and installed in target orgs.

packageId: Package ID (0Ho...) or package alias
installationKey: optional key to protect the version
codeVersion: version number, e.g. '1.0.0.NEXT'
wait: minutes to wait for version creation to complete

Input parameters:

- `codeVersion` (string): Version number, e.g. '1.0.0.NEXT'
- `installationKey` (string): Installation key for the package version
- `packageId` (string, required): Package ID (0Ho...) or package alias
- `wait` (integer): Minutes to wait for version creation

### `sf_install_package` (~155 tokens)

Install Package

Installs a package version into a target org using the SF CLI. Supports both managed and unlocked packages. Requires the package version ID (04t...) or an alias.

packageId: package version ID (04t...) or alias
targetOrg: target org alias (defaults to SF_ALIAS env var)
installationKey: installation key if the package version is protected
wait: minutes to wait for installation to complete

Input parameters:

- `installationKey` (string): Installation key if package is protected
- `packageId` (string, required): Package version ID (04t...) or alias to install
- `targetOrg` (string): Target org alias (defaults to SF_ALIAS env var)
- `wait` (integer): Minutes to wait for installation

### `sf_uninstall_package` (~142 tokens)

Uninstall Package

Uninstalls a second-generation package from a target org using the SF CLI. Removes all metadata delivered by the package. Use before reinstalling a broken package, or to clean up a package no longer needed.

packageId: package version ID (04t...) or alias to uninstall
targetOrg: target org alias (defaults to SF_ALIAS env var)
wait: minutes to wait for uninstall to complete

Input parameters:

- `packageId` (string, required): Package version ID (04t...) or alias to uninstall
- `targetOrg` (string): Target org alias (defaults to SF_ALIAS env var)
- `wait` (integer): Minutes to wait for uninstall to complete

### `sf_devops_create_work_item` (~137 tokens)

Create DevOps Center Work Item

Creates a work item in Salesforce DevOps Center. Work items represent units of work (features, bug fixes, etc.) that move through pipeline stages from development to production.

name: work item name/title
description: optional description
pipelineStageId: optional pipeline stage ID to assign to
assignedToId: optional user ID to assign the work item to

Input parameters:

- `assignedToId` (string): User ID to assign the work item to
- `description` (string): Work item description
- `name` (string, required): Work item name/title
- `pipelineStageId` (string): Pipeline stage ID to assign to

### `sf_devops_promote_work_item` (~72 tokens)

Promote DevOps Center Work Item

Promotes a DevOps Center work item to the next pipeline stage. Moving work items through the pipeline represents the progression of changes from development environments toward production.

workItemId: the DevOps Center work item record ID

Input parameters:

- `workItemId` (string, required): DevOps Center work item ID

### `sf_check_code_coverage` (~107 tokens)

Check Apex Code Coverage

Retrieves Apex code coverage statistics from the org using the Tooling API. Shows which classes meet or fail the 75% coverage threshold required for deployment. Use after running Apex tests to assess coverage.

className: optional filter to show only classes matching this name
minCoverage: optional threshold — only return classes below this coverage percentage

Input parameters:

- `className` (string): Filter by Apex class name (partial match)
- `minCoverage` (integer): Only show classes below this coverage %

### `sf_detect_devops_merge_conflict` (~75 tokens)

Detect DevOps Center Merge Conflicts

Checks a DevOps Center work item for merge conflicts. Returns the work item details and any associated merge conflict records. Use before promoting a work item to identify conflicts that need resolution.

workItemId: DevOps Center work item ID

Input parameters:

- `workItemId` (string, required): DevOps Center work item ID

### `sf_resolve_devops_merge_conflict` (~100 tokens)

Resolve DevOps Center Merge Conflict

Marks a merge conflict in DevOps Center as resolved with a specified resolution strategy. Use after manually resolving conflicts in the source control system.

conflictId: merge conflict record ID
resolution: resolution strategy — 'ours' (keep our changes), 'theirs' (accept incoming), or 'manual' (already resolved)

Input parameters:

- `conflictId` (string, required): Merge conflict record ID
- `resolution` (string, required): Resolution strategy

### `sf_checkout_devops_work_item` (~78 tokens)

Checkout DevOps Center Work Item

Checks out a DevOps Center work item, moving it to 'In Progress' status. This signals that a developer is actively working on the changes for this work item.

workItemId: DevOps Center work item ID to check out

Input parameters:

- `workItemId` (string, required): DevOps Center work item ID to check out

### `sf_commit_devops_work_item` (~84 tokens)

Commit DevOps Center Work Item

Commits changes for a DevOps Center work item by creating a commit record associated with the work item. Records the commit message for audit tracking.

workItemId: DevOps Center work item ID
message: commit message describing the changes

Input parameters:

- `message` (string, required): Commit message
- `workItemId` (string, required): DevOps Center work item ID

### `sf_create_devops_pull_request` (~101 tokens)

Create DevOps Center Pull Request

Creates a pull request record for a DevOps Center work item. Pull requests represent code review requests before merging changes to a target branch or pipeline stage.

workItemId: DevOps Center work item ID
title: pull request title
description: optional pull request description

Input parameters:

- `description` (string): Pull request description
- `title` (string, required): Pull request title
- `workItemId` (string, required): DevOps Center work item ID

### `sf_list_devops_projects` (~45 tokens)

List DevOps Center Projects

Lists all DevOps Center projects in the org. Returns project names, IDs, and associated pipeline information. Use to discover project IDs needed for other DevOps Center operations.

### `sf_list_devops_work_items` (~110 tokens)

List DevOps Center Work Items

Lists DevOps Center work items, optionally filtered by project or pipeline stage. Use to get an overview of work in progress.

projectId: optional filter by DevOps Center project ID
stageId: optional filter by pipeline stage ID
limit: maximum records to return (default: 20)

Input parameters:

- `limit` (integer): Maximum records to return
- `projectId` (string): Filter by DevOps Center project ID
- `stageId` (string): Filter by pipeline stage ID

### `sf_check_devops_commit_status` (~60 tokens)

Check DevOps Center Commit Status

Retrieves the commit and deployment status for a DevOps Center work item. Shows recent commits and their deployment outcomes.

workItemId: DevOps Center work item ID

Input parameters:

- `workItemId` (string, required): DevOps Center work item ID

### `sf_promote_devops_work_item` (~96 tokens)

Promote DevOps Center Work Item to Stage

Promotes a DevOps Center work item to a specific pipeline stage by ID. Use to move work items forward in the pipeline when you know the exact target stage.

workItemId: DevOps Center work item ID
targetStageId: ID of the target pipeline stage

Input parameters:

- `targetStageId` (string, required): Target pipeline stage ID
- `workItemId` (string, required): DevOps Center work item ID

### `sf_create_product` (~185 tokens)

Create Product

Creates a Salesforce Product2 record. Products represent items or services that can be added to Opportunities and Quotes via Opportunity Line Items. Use with sf_create_price_book to set pricing.

name: product name
productCode: optional SKU or product code
description: optional description
isActive: whether the product is available for use (default: true)
family: product family/category, e.g. 'Hardware'
quantityUnitOfMeasure: unit of measure, e.g. 'Each', 'Hour'

Input parameters:

- `description` (string): Product description
- `family` (string): Product family, e.g. 'Hardware'
- `isActive` (boolean): Whether the product is active
- `name` (string, required): Product name
- `productCode` (string): Product code / SKU
- `quantityUnitOfMeasure` (string): Unit of measure, e.g. 'Each'

### `sf_create_price_book` (~203 tokens)

Create Price Book

Creates a Pricebook2 record and optionally adds products with pricing via PricebookEntry records. Price books define the prices for your products. Each org has one standard price book; additional custom price books can be used for different customer segments or regions.

name: price book name
isActive: whether the price book is active
isStandard: true only for the standard price book
currencyIsoCode: ISO currency code (e.g. 'USD')
products: optional array of {productId, unitPrice, useStandardPrice?} to add to the price book

Input parameters:

- `currencyIsoCode` (string): Currency ISO code, e.g. 'USD'
- `description` (string): Description
- `isActive` (boolean): Whether the price book is active
- `isStandard` (boolean): Whether this is the standard price book
- `name` (string, required): Price book name
- `products` (array): Products to add to this price book

### `sf_create_entitlement_process` (~180 tokens)

Create Entitlement Process

Creates an Entitlement Process (SLA policy) that defines the time-based steps and milestones required to resolve cases. Entitlement processes automate service level agreement (SLA) enforcement.

fullName: entitlement process API name
name: display name
businessHoursName: optional business hours to apply
entryStartDateField: field that starts the SLA clock
milestones: array of milestone definitions to include

Input parameters:

- `businessHoursName` (string): Business hours name (optional)
- `description` (string): Description
- `entryStartDateField` (string): Start date field API name
- `exitCriteriaBooleanFilter` (string): Boolean filter for exit criteria
- `fullName` (string, required): Entitlement process API name
- `milestones` (array): Milestones to include in the process
- `name` (string, required): Display name

### `sf_create_milestone` (~134 tokens)

Create Milestone Type

Creates a Milestone Type that can be referenced in Entitlement Processes to define SLA checkpoints. Milestones represent required steps (e.g., 'First Response', 'Resolution') with time-based targets.

fullName: milestone type API name
name: display name
description: optional description
recurrenceType: how the milestone repeats — recursIndependently, recursChained, or noRecurrence

Input parameters:

- `description` (string): Description
- `fullName` (string, required): Milestone type API name
- `name` (string, required): Display name
- `recurrenceType` (string): Recurrence behaviour

### `sf_create_visualforce_page` (~225 tokens)

Create Visualforce Page

Creates a Visualforce page in the Salesforce org via the Metadata API. Provide the page API name, label, and Visualforce markup content (must include an <apex:page> tag). Optionally specify a standard controller, extensions, and whether to show the header/sidebar. The page is deployed immediately and accessible at /apex/PageName.

Input parameters:

- `apiVersion` (string): API version, e.g. '62.0'
- `content` (string, required): Visualforce markup (must include <apex:page> tag)
- `description` (string): Description of the page
- `extensions` (string): Comma-separated Apex class names for controller extensions
- `label` (string, required): Display label for the page
- `pageName` (string, required): API name for the Visualforce page, e.g. 'MyPage'
- `showHeader` (boolean): Whether to show the Salesforce header
- `sidebar` (boolean): Whether to show the sidebar
- `standardController` (string): Standard controller object API name, e.g. 'Account'

### `sf_create_visualforce_component` (~154 tokens)

Create Visualforce Component

Creates a reusable Visualforce component (ApexComponent) in the Salesforce org via the Metadata API. Provide the component API name, label, and Visualforce markup (must include an <apex:component> tag). Components can be included in Visualforce pages using <c:ComponentName/>.

Input parameters:

- `apiVersion` (string): API version, e.g. '62.0'
- `componentName` (string, required): API name for the Visualforce component, e.g. 'MyComponent'
- `content` (string, required): Visualforce component markup (must include <apex:component> tag)
- `description` (string): Description of the component
- `label` (string, required): Display label for the component

### `sf_create_visualforce_email_template` (~162 tokens)

Create Visualforce Email Template

Creates a Visualforce email template in the Salesforce org. Provide the template name, subject, recipient type (Contact, Lead, or User), related entity type, and the HTML body with Visualforce markup. A plain-text body is also required for email clients that don't support HTML.

Input parameters:

- `description` (string): Description of the template
- `htmlBody` (string, required): HTML body with Visualforce markup
- `recipientType` (string, required): Type of recipient
- `relatedEntityType` (string, required): Related object API name, e.g. 'Account'
- `subject` (string, required): Email subject line
- `templateName` (string, required): API name for the email template
- `textBody` (string, required): Plain-text version of the email body

### `sf_create_quick_action` (~160 tokens)

Create Quick Action

Creates an object-specific quick action on a Salesforce object via the Metadata API. Supports Create, Update, LogACall, and SendEmail action types. Optionally specify a target object (for Create type) and the fields to include in the action layout.

Input parameters:

- `actionName` (string, required): Quick action API name
- `actionType` (string, required): Type of quick action
- `description` (string): Description of the quick action
- `fields` (array): Fields to include in the quick action layout
- `label` (string, required): Display label for the quick action
- `objectName` (string, required): Object API name, e.g. 'Account'
- `targetObject` (string): Target object API name (required for Create type)

### `sf_create_global_action` (~114 tokens)

Create Global Quick Action

Creates a global quick action accessible from the global navigation bar in Salesforce. Supports Create, LogACall, SendEmail, and Canvas action types. Global actions are not tied to a specific object and appear in the global quick actions menu.

Input parameters:

- `actionName` (string, required): Global action API name
- `actionType` (string, required): Type of global action
- `description` (string): Description
- `label` (string, required): Display label
- `targetObject` (string): Target object API name (for Create type)

### `sf_create_custom_button` (~165 tokens)

Create Custom Button or Link

Creates a custom button or link on a Salesforce object via the Metadata API (WebLink). Supports list buttons, detail page buttons, and mass action buttons. Content can be a URL, JavaScript, or a Visualforce page reference. Specify how the target opens (sidebar, new window, replace current page, etc.).

Input parameters:

- `buttonName` (string, required): Button API name
- `buttonType` (string, required): Button placement type
- `content` (string, required): URL, JavaScript code, or Visualforce page name
- `contentSource` (string, required): Content source type
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Account'
- `openType` (string, required): How to open the button target

### `sf_create_field_set` (~140 tokens)

Create Field Set

Creates a field set on a Salesforce object via the Metadata API. Field sets are named groupings of fields used in dynamic forms, Apex code, and LWC. Specify the displayed fields (in the field set) and optionally additional available fields that users can add.

Input parameters:

- `availableFields` (array): Additional available fields not in the field set
- `description` (string): Description
- `fieldSetName` (string, required): Field set API name
- `fields` (array, required): Array of field API names to include
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Account'

### `sf_create_flexipage` (~180 tokens)

Create Lightning App Builder Page (FlexiPage)

Creates a Lightning App Builder page (FlexiPage) in the Salesforce org via the Metadata API. Supports AppPage, RecordPage, and HomePage types. Specify the page template (e.g. header_and_right_rail, header_and_three_regions) and for RecordPage provide the object API name. The page can then be activated and assigned via Setup > Lightning App Builder.

Input parameters:

- `description` (string): Description
- `label` (string, required): Display label
- `masterLabel` (string, required): Master label for the page
- `objectApiName` (string): Object API name (required for RecordPage)
- `pageName` (string, required): FlexiPage API name
- `pageType` (string, required): Type of Lightning page
- `template` (string): Page template name, e.g. 'header_and_right_rail'

### `sf_create_path_assistant` (~156 tokens)

Create Path Assistant (Sales Path)

Creates a Path Assistant (Sales Path or Kanban path) for a Salesforce object picklist field via the Metadata API. Define path items for each picklist value with optional guidance text, info titles, and key fields to highlight at each stage. Activate the path to make it visible to users.

Input parameters:

- `fieldName` (string, required): Picklist field API name, e.g. 'StageName'
- `isActive` (boolean): Whether the path is active
- `label` (string, required): Display label
- `objectName` (string, required): Object API name, e.g. 'Opportunity'
- `pathItems` (array, required): Path items for each picklist value
- `pathName` (string, required): Path assistant API name

### `sf_create_custom_application` (~160 tokens)

Create Lightning Application

Creates a Lightning Application (App) in the Salesforce org via the Metadata API. Supports Standard and Console navigation types. Specify tabs to include, form factor (desktop or mobile), and optional utility bar components. The app appears in the App Launcher after creation.

Input parameters:

- `appName` (string, required): Application API name
- `description` (string): Description
- `formFactor` (string): Form factor: Large (desktop) or Small (mobile)
- `isNavAutoTempTabsDisabled` (boolean): Disable auto-temporary tabs in nav
- `label` (string, required): Display label
- `navType` (string): Navigation type
- `tabs` (array): Tab API names to include
- `utilityBar` (array): Utility bar items

### `sf_create_knowledge_article_type` (~129 tokens)

Create Knowledge Article Type

Creates a Knowledge Article Type (a custom object for Salesforce Knowledge) via the Metadata API. The article type name must end in __kav. Optionally define custom fields for the article type such as text or long text area fields. Requires Knowledge to be enabled in the org.

Input parameters:

- `articleTypeName` (string, required): Article type API name (must end in __kav)
- `description` (string): Description
- `fields` (array): Custom fields for the article type
- `label` (string, required): Singular label
- `pluralLabel` (string, required): Plural label

### `sf_create_business_hours` (~133 tokens)

Create Business Hours

Creates Business Hours in Salesforce via the Metadata API. Define working hours for each day of the week, specify the time zone, and mark days as active or inactive. Business Hours are used with Entitlement Processes, Escalation Rules, and Holidays to calculate SLA milestones.

Input parameters:

- `days` (array, required): Business hours for each day
- `isActive` (boolean): Whether business hours are active
- `isDefault` (boolean): Whether this is the default business hours
- `name` (string, required): Business hours name
- `timeZone` (string, required): Time zone, e.g. 'America/New_York'

### `sf_create_holiday` (~175 tokens)

Create Holiday

Creates a Holiday record in Salesforce via the Metadata API. Holidays are used with Business Hours to exclude specific days from SLA calculations. Supports both one-time and recurring holidays (e.g. yearly). Optionally associate the holiday with specific Business Hours.

Input parameters:

- `activityDate` (string): Date for non-recurring holiday (YYYY-MM-DD)
- `businessHoursName` (string): Associated business hours name
- `description` (string): Description
- `isRecurring` (boolean): Whether this holiday recurs annually
- `name` (string, required): Holiday name
- `recurrenceEndDateOnly` (string): Recurrence end date (YYYY-MM-DD)
- `recurrenceStartDate` (string): Recurrence start date (YYYY-MM-DD)
- `recurrenceType` (string): Recurrence type, e.g. 'RecursYearly'

### `sf_create_auth_provider` (~166 tokens)

Create Auth Provider

Creates an Auth Provider in Salesforce for SSO or social login via the Metadata API. Supports OpenID Connect, Facebook, Google, GitHub, Salesforce, and Custom providers. Provide the consumer key and secret from the external identity provider. Optionally specify an Apex registration handler class for custom user provisioning logic.

Input parameters:

- `consumerKey` (string, required): Consumer key / client ID
- `consumerSecret` (string, required): Consumer secret / client secret
- `customErrorUrl` (string): Custom error URL
- `defaultScopes` (string): Default OAuth scopes
- `friendlyName` (string, required): Display name
- `providerName` (string, required): Auth provider API name
- `providerType` (string, required): Provider type
- `registrationHandler` (string): Apex class name for registration handler

### `sf_create_saml_sso_config` (~210 tokens)

Create SAML SSO Configuration

Creates a SAML Single Sign-On (SSO) configuration in Salesforce via the Metadata API. Provide the identity provider issuer URL, base64-encoded IdP certificate, login URL, and user identity mapping settings. Supports username, federation ID, and user ID identity types. Used to enable SAML 2.0 federation with external identity providers.

Input parameters:

- `attributeName` (string): SAML attribute name (for Attribute identity location)
- `identityLocation` (string): Where user identity is stored
- `identityProviderCertificate` (string, required): Base64-encoded IdP certificate
- `identityType` (string): User identity type
- `issuer` (string, required): Identity provider issuer URL
- `loginUrl` (string, required): Identity provider login URL
- `logoutUrl` (string): Identity provider logout URL
- `name` (string, required): SSO configuration API name
- `requestSignatureMethod` (string): Signature method
- `samlVersion` (string): SAML version

### `sf_create_connected_app_oauth_policy` (~132 tokens)

Update Connected App OAuth Policies

Updates the OAuth policies on an existing Connected App in Salesforce via the Metadata API. Configure the refresh token policy (infinite, specific duration, or expire on password change), single logout URL, session timeout, and IP relaxation settings. Use this to tighten or adjust security policies on deployed Connected Apps.

Input parameters:

- `connectedAppName` (string, required): Connected App API name
- `ipRelaxation` (string): IP relaxation policy
- `refreshTokenPolicy` (string, required): Refresh token policy
- `sessionTimeout` (string): Session timeout value
- `singleLogoutUrl` (string): Single logout URL

### `sf_create_sandbox` (~138 tokens)

Create Sandbox

Creates a new sandbox org via the Tooling API (SandboxInfo object). Supports Developer, Developer Pro, Partial Copy, and Full sandbox types. Optionally specify an Apex class to run after the sandbox copy completes. The sandbox creation is asynchronous — use sf_list_sandboxes to monitor the status.

Input parameters:

- `apexClassId` (string): Apex class ID to run after sandbox copy
- `autoActivate` (boolean): Automatically activate the sandbox after creation
- `description` (string): Description
- `licenseType` (string, required): Sandbox license type
- `sandboxName` (string, required): Sandbox name (max 10 chars, alphanumeric)

### `sf_refresh_sandbox` (~109 tokens)

Refresh Sandbox

Refreshes an existing sandbox org by re-copying it from production via the Tooling API. The sandbox must already exist (use sf_create_sandbox for new sandboxes). Refreshing resets the sandbox to the current state of the production org. The refresh is asynchronous — use sf_list_sandboxes to monitor status.

Input parameters:

- `autoActivate` (boolean): Automatically activate after refresh
- `licenseType` (string, required): Sandbox license type
- `sandboxName` (string, required): Sandbox name to refresh

### `sf_list_sandboxes` (~61 tokens)

List Sandboxes

Lists all sandbox orgs associated with the production org, including their status, license type, and dates. Returns data from the SandboxInfo Tooling API object. Use this to monitor sandbox creation and refresh status. Must be called from the production org.

### `sf_create_push_topic` (~193 tokens)

Create Streaming API PushTopic

Creates a Streaming API PushTopic for real-time record change notifications via the SObject API. Clients subscribe to /topic/TopicName using the CometD protocol. Specify the SOQL query that filters which records trigger events, and configure which operations (create, update, delete, undelete) and fields trigger notifications.

Input parameters:

- `apiVersion` (number): API version number (e.g. 62)
- `notifyForFields` (string): Which fields trigger notifications
- `notifyForOperationCreate` (boolean): Notify on record create
- `notifyForOperationDelete` (boolean): Notify on record delete
- `notifyForOperationUndelete` (boolean): Notify on record undelete
- `notifyForOperationUpdate` (boolean): Notify on record update
- `query` (string, required): SOQL query for the PushTopic
- `topicName` (string, required): PushTopic name (max 25 chars)

### `sf_configure_change_data_capture` (~96 tokens)

Configure Change Data Capture

Enables Change Data Capture (CDC) for the specified Salesforce objects via the Metadata API. CDC publishes change events to the /data/ChangeEvents channel when records are created, updated, deleted, or undeleted. Provide an array of object API names to enable CDC on. Standard and custom objects are supported.

Input parameters:

- `entities` (array, required): Object API names to enable CDC on, e.g. ['Account', 'Contact']

### `sf_create_platform_cache_partition` (~132 tokens)

Create Platform Cache Partition

Creates a Platform Cache partition in the Salesforce org via the Metadata API. Platform Cache improves app performance by storing data server-side close to Apex code. Allocate capacity for session cache (per-user, per-session) and org cache (shared across all users). Optionally mark as the default partition.

Input parameters:

- `description` (string): Description
- `isDefaultPartition` (boolean): Whether this is the default partition
- `orgCacheSize` (integer): Org cache size in MB
- `partitionName` (string, required): Cache partition API name
- `sessionCacheSize` (integer): Session cache size in MB

### `sf_create_aura_component` (~194 tokens)

Create Aura (Lightning) Component

Generates an Aura (Lightning Component Framework) component scaffold. Returns the complete bundle file contents: .cmp markup, JavaScript controller, CSS stylesheet, design resource, and metadata XML. Specify interfaces the component implements (e.g. force:appHostable for App Builder), attributes with types and defaults, and an optional Apex controller. Use sf_create_lwc for new development — Aura is for legacy migration scenarios.

Input parameters:

- `accessLevel` (string): Access level
- `attributes` (array): Component attributes
- `componentName` (string, required): Aura component name (PascalCase)
- `controller` (string): Apex controller class name
- `description` (string): Description
- `implements` (string): Comma-separated interfaces, e.g. 'force:appHostable,flexipage:availableForAllPageTypes'
- `isExposed` (boolean): Whether the component is exposed in App Builder

### `sf_create_aura_app` (~141 tokens)

Create Aura Application

Generates an Aura Application bundle scaffold. Returns the .app file content with the specified access level, optional parent app extension (e.g. force:slds for SLDS styling), included components, and body content. Aura Apps are standalone Lightning applications accessible via /c/AppName.app URL.

Input parameters:

- `access` (string): Access level
- `appName` (string, required): Aura app name (PascalCase)
- `bodyContent` (string): Body markup content
- `description` (string): Description
- `extends` (string): Parent app to extend, e.g. 'force:slds'
- `includes` (array): Component names to include

### `sf_create_aura_event` (~108 tokens)

Create Aura Event

Generates an Aura Event scaffold (.evt file content). Supports COMPONENT events (propagate up the component hierarchy) and APPLICATION events (broadcast to all subscribed components). Define event attributes with names and types. Components fire events with component.getEvent() and APPLICATION events with $A.get().

Input parameters:

- `attributes` (array): Event attributes
- `description` (string): Description
- `eventName` (string, required): Aura event name (PascalCase)
- `eventType` (string, required): Event type

### `sf_activate_flow` (~93 tokens)

Activate Flow Version

Activates a specific Flow version (or the latest version) via the Tooling API. Only one version of a flow can be active at a time — activating a new version automatically deactivates the previous active version. Use sf_list_flow_versions to discover available versions before activating.

Input parameters:

- `flowApiName` (string, required): Flow API name
- `versionNumber` (integer): Version number to activate (defaults to latest)

### `sf_deactivate_flow` (~78 tokens)

Deactivate Flow

Deactivates the currently active version of a Flow via the Tooling API, setting its status to Draft. This stops the flow from being triggered. Use sf_activate_flow to re-activate a specific version. Note: deactivating a flow does not delete it.

Input parameters:

- `flowApiName` (string, required): Flow API name to deactivate

### `sf_list_flow_versions` (~111 tokens)

List Flow Versions

Lists all versions of a specific Flow, or all Flows in the org, via the Tooling API. Returns version number, status (Active, Draft, Obsolete), description, and creation date for each version. Optionally filter to exclude deactivated (Obsolete) versions. Use flowApiName to filter to a single flow.

Input parameters:

- `flowApiName` (string): Flow API name (omit to list all flows)
- `includeDeactivated` (boolean): Whether to include deactivated versions

### `sf_create_flow_from_xml` (~156 tokens)

Deploy Flow from Raw XML

Deploys a Salesforce Flow directly from raw XML using the Metadata API zip deploy. Use this for complex flows that are too advanced for sf_create_flow's parameter-based builder — paste the full Flow XML and it deploys it directly. Optionally activates the flow after deployment. The flowXml must be a complete Flow metadata XML document.

Input parameters:

- `activate` (boolean): Activate the flow after deployment (default: true). Set to false to deploy as inactive draft.
- `flowApiName` (string, required): API name of the flow to deploy, e.g. 'My_Flow'
- `flowXml` (string, required): Complete Flow XML content (the full metadata file, starting with <?xml version...> or <Flow xmlns...>)

### `sf_translate_custom_label` (~138 tokens)

Translate Custom Label

Adds or updates a translation for a Salesforce Custom Label via the Metadata API (Translations type). Provide the label API name, the target language code (e.g. 'fr' for French, 'de' for German, 'ja' for Japanese), and the translated value. Translation Workbench must be enabled in the org. Existing translations for the same label and language will be overwritten.

Input parameters:

- `labelName` (string, required): Custom label full name (API name)
- `language` (string, required): Language code, e.g. 'fr', 'de', 'es', 'ja'
- `translatedValue` (string, required): Translated text value

### `sf_translate_field_label` (~175 tokens)

Translate Field Label

Adds or updates a translation for a field label (and optionally help text) on a Salesforce object via the Metadata API (CustomObjectTranslation type). Provide the object API name, field API name, language code (e.g. 'fr', 'de', 'es'), and the translated label. Optionally include translated help text. Translation Workbench must be enabled.

Input parameters:

- `fieldName` (string, required): Field API name, e.g. 'Name' or 'MyField__c'
- `language` (string, required): Language code, e.g. 'fr', 'de', 'es', 'ja'
- `objectName` (string, required): Object API name, e.g. 'Account'
- `translatedHelpText` (string): Translated help text (optional)
- `translatedLabel` (string, required): Translated field label

## Diagnostics

Captured diagnostic sections: Provenance, Vulnerabilities, Dependencies. The full working is on the page: https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp#diagnostics

## Score history

- 2026-08-03: 65
- 2026-08-02: 65
- 2026-08-01: 26
- 2026-07-31: 35
- 2026-07-30: 15
- 2026-07-29: 8
- 2026-07-28: 24
- 2026-07-27: 43

## Links

- npm package: https://www.npmjs.com/package/salesforce-metadata-mcp
- Socket report: https://socket.dev/npm/package/salesforce-metadata-mcp
- Repository: https://github.com/semwalajay83-sem/salesforce-metadata-mcp
- Changelog RSS feed: https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp/changelog.xml
- Changelog JSON feed: https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp/changelog.json
- HTML version of this page: https://verifymcp.io/servers/semwalajay83-sem-salesforce-metadata-mcp/salesforce-metadata-mcp
