salesforce-metadata-mcp 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.0] - 2026-05-28
4
+
5
+ ### New Tools — 45 Additions Across 11 Categories
6
+
7
+ #### Admin & Org Management (6 new)
8
+ - `sf_create_user_role_hierarchy` — Create a UserRole in the Salesforce role hierarchy with optional parent role
9
+ - `sf_reset_user_password` — Reset a user's password and send a password-reset email
10
+ - `sf_freeze_user` — Freeze or unfreeze a user account (blocks login without deactivating)
11
+ - `sf_create_territory` — Create an Enterprise Territory Management (ETM) Territory2
12
+ - `sf_assign_territory_to_user` — Assign a user to a Territory2 via UserTerritory2Association
13
+ - `sf_create_forecast_hierarchy` — Configure a Collaborative Forecasting hierarchy manager relationship
14
+
15
+ #### Object Schema (5 new)
16
+ - `sf_delete_custom_object` — Permanently delete a custom object and all its records (destructive)
17
+ - `sf_delete_custom_field` — Permanently delete a custom field from an object (destructive)
18
+ - `sf_create_rollup_summary_field` — Create a Roll-Up Summary field (COUNT/SUM/MIN/MAX) on a master object
19
+ - `sf_create_external_id_field` — Create an External ID indexed field for upsert operations
20
+ - `sf_enable_object_features` — Enable history tracking, activities, reports, search, feeds, and Bulk API on a custom object
21
+
22
+ #### Automation & Flows (4 new)
23
+ - `sf_update_flow` — Update a Flow's label, description, or API version
24
+ - `sf_clone_flow` — Clone a Flow to a new API name and label
25
+ - `sf_create_flow_test` — Create a Flow Interview Test definition for the Flow Test Manager
26
+ - `sf_create_invocable_action` — Register a custom Invocable Action wrapping an @InvocableMethod Apex class
27
+
28
+ #### Apex Development (5 new)
29
+ - `sf_search_apex` — Search Apex class and trigger source code for a keyword across the org
30
+ - `sf_get_apex_logs` — List recent Apex debug log entries with metadata (operation, duration, size)
31
+ - `sf_get_apex_log_body` — Retrieve the full content of an Apex debug log by ID
32
+ - `sf_create_apex_batch` — Generate and deploy a complete Database.Batchable Apex batch class
33
+ - `sf_create_apex_scheduler` — Generate and deploy a Schedulable Apex class, with optional immediate scheduling
34
+
35
+ #### Deployment & Environment Management (5 new)
36
+ - `sf_rollback_deployment` — Cancel an in-progress metadata deployment by async job ID
37
+ - `sf_create_scratch_org` — Create a new scratch org using SF CLI (requires Dev Hub)
38
+ - `sf_create_sandbox` — Create a new sandbox (Developer, Developer_Pro, Partial, or Full)
39
+ - `sf_refresh_sandbox` — Refresh an existing sandbox to match the current production state
40
+ - `sf_export_package_xml` — Generate a package.xml manifest by listing all components of specified metadata types
41
+
42
+ #### Experience Cloud (3 new)
43
+ - `sf_create_experience_container` — Create a container region within an Experience Cloud page
44
+ - `sf_set_experience_site_login` — Configure login, self-registration, and SSO settings for an Experience site
45
+ - `sf_create_cms_content` — Create a CMS content item in a Salesforce CMS workspace
46
+
47
+ #### Data Management (4 new)
48
+ - `sf_export_records` — Export Salesforce records as CSV data via SOQL
49
+ - `sf_upsert_record` — Upsert a record using an External ID field for matching
50
+ - `sf_get_record` — Retrieve a single record by 15/18-char ID with optional field selection
51
+ - `sf_search_records` — Cross-object text search using SOSL with configurable search group and object list
52
+
53
+ #### Integrations & Events (3 new)
54
+ - `sf_create_platform_event_subscription` — Create an Apex trigger subscribing to a Platform Event channel
55
+ - `sf_create_change_data_capture` — Enable Change Data Capture for one or more Salesforce objects
56
+ - `sf_create_rest_resource` — Create and deploy an Apex REST resource (@RestResource) class
57
+
58
+ #### Monitoring & Observability (4 new)
59
+ - `sf_get_org_limits` — Retrieve current API and governor limit usage via the Limits REST API
60
+ - `sf_get_flow_errors` — Retrieve Flow interview fault records with error messages and related records
61
+ - `sf_get_apex_test_results` — Query Apex test results from recent test runs via Tooling API
62
+ - `sf_get_deployment_history` — Retrieve recent deployment history with status, component counts, and errors
63
+
64
+ #### Agentforce (3 new)
65
+ - `sf_create_agent_channel` — Create a BotChannel connecting an agent to a deployment channel (Embedded Service, Slack, etc.)
66
+ - `sf_clone_agent` — Clone an Agentforce Agent with all its topics, actions, and planner bundle
67
+ - `sf_export_agent` — Export a complete agent configuration as JSON for documentation or migration
68
+
69
+ #### OmniStudio (3 new)
70
+ - `sf_export_omnistudio_component` — Export any OmniStudio component as JSON for backup or migration
71
+ - `sf_import_omnistudio_component` — Import an OmniStudio component from previously exported JSON
72
+ - `sf_create_document_generation` — Create an OmniStudio Document Generation configuration (OmniDocumentGenerationConfig)
73
+
74
+ ---
75
+
3
76
  ## [2.4.0] - 2026-05-28
4
77
 
5
78
  ### New Tools — 14 Additions Across 6 Categories
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # salesforce-metadata-mcp
2
2
 
3
- [![Version](https://img.shields.io/badge/version-2.4.0-blue.svg)](https://npmjs.com/package/salesforce-metadata-mcp)
3
+ [![Version](https://img.shields.io/badge/version-2.5.0-blue.svg)](https://npmjs.com/package/salesforce-metadata-mcp)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
5
  [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io)
6
6
 
7
- **The most comprehensive Salesforce MCP server.** 155+ tools for building, configuring, and automating Salesforce orgs directly from Claude or any MCP client — covering metadata, Apex, LWC, Agentforce agents, OmniStudio, OmniChannel, Experience Cloud, Field Service, Messaging, Einstein AI, audit trail, bulk data, users, reports, security, and more.
7
+ **The most comprehensive Salesforce MCP server.** 200+ tools for building, configuring, and automating Salesforce orgs directly from Claude or any MCP client — covering metadata, Apex, LWC, Agentforce agents, OmniStudio, OmniChannel, Experience Cloud, Field Service, Messaging, Einstein AI, audit trail, bulk data, users, reports, security, territories, sandboxes, CDC, REST resources, document generation, and more.
8
8
 
9
9
  ---
10
10
 
@@ -46,6 +46,26 @@ See [SETUP.md](SETUP.md) for all authentication methods and detailed setup instr
46
46
 
47
47
  ---
48
48
 
49
+ ## What's New in v2.5.0
50
+
51
+ 45 new tools across 11 categories:
52
+
53
+ - **Admin & Org Management** — Role hierarchy, reset password, freeze user, ETM territories, forecast hierarchy
54
+ - **Object Schema** — Delete custom objects/fields, roll-up summary fields, external ID fields, enable object features
55
+ - **Automation & Flows** — Update/clone flows, flow tests, custom invocable actions
56
+ - **Apex Development** — Search Apex source code, get/read debug logs, create batch and scheduler classes
57
+ - **Deployment & Environments** — Cancel deployments, create scratch orgs, create/refresh sandboxes, export package.xml
58
+ - **Experience Cloud** — Experience containers, site login config, CMS content creation
59
+ - **Data Management** — Export records to CSV, upsert by external ID, get record by ID, SOSL search
60
+ - **Integrations & Events** — Platform Event trigger subscriptions, CDC enablement, Apex REST resources
61
+ - **Monitoring** — Org limits usage, flow runtime errors, Apex test results, deployment history
62
+ - **Agentforce** — Agent channels, clone agents, export agent configurations
63
+ - **OmniStudio** — Export/import components, document generation templates
64
+
65
+ See [CHANGELOG.md](CHANGELOG.md) for full release notes.
66
+
67
+ ---
68
+
49
69
  ## What's New in v2.4.0
50
70
 
51
71
  14 new tools across 6 categories:
package/dist/index.js CHANGED
@@ -6,14 +6,14 @@ import { createServer } from "http";
6
6
  import { registerTools } from "./tools/index.js";
7
7
  const server = new McpServer({
8
8
  name: "salesforce-metadata-mcp",
9
- version: "2.4.0",
9
+ version: "2.5.0",
10
10
  });
11
11
  registerTools(server);
12
12
  // ─── Transport: stdio ─────────────────────────────────────────────────────────
13
13
  async function runStdio() {
14
14
  const transport = new StdioServerTransport();
15
15
  await server.connect(transport);
16
- console.error("Salesforce Metadata MCP server v2.4.0 running on stdio");
16
+ console.error("Salesforce Metadata MCP server v2.5.0 running on stdio");
17
17
  }
18
18
  // ─── Transport: HTTP ──────────────────────────────────────────────────────────
19
19
  function readBody(req) {
@@ -38,7 +38,7 @@ async function runHTTP() {
38
38
  const url = req.url ?? "/";
39
39
  if (url === "/health" && req.method === "GET") {
40
40
  res.writeHead(200, { "Content-Type": "application/json" });
41
- res.end(JSON.stringify({ status: "ok", server: "salesforce-metadata-mcp", version: "2.4.0"}));
41
+ res.end(JSON.stringify({ status: "ok", server: "salesforce-metadata-mcp", version: "2.5.0"}));
42
42
  return;
43
43
  }
44
44
  if (url === "/mcp" && req.method === "POST") {
@@ -64,7 +64,7 @@ async function runHTTP() {
64
64
  res.end(JSON.stringify({ error: "Not found" }));
65
65
  });
66
66
  httpServer.listen(port, () => {
67
- console.error(`Salesforce Metadata MCP server v2.4.0 running on http://localhost:${port}/mcp`);
67
+ console.error(`Salesforce Metadata MCP server v2.5.0 running on http://localhost:${port}/mcp`);
68
68
  });
69
69
  }
70
70
  // ─── Entry point ──────────────────────────────────────────────────────────────
@@ -1790,4 +1790,319 @@ export const CreateEinsteinBotSchema = z.object({
1790
1790
  messages: z.array(z.string()).optional().describe("Bot messages to show"),
1791
1791
  })).optional().describe("Bot dialogs"),
1792
1792
  }).strict();
1793
+ // ─── v2.5.0 — NEW TOOLS ──────────────────────────────────────────────────────
1794
+ export const CreateUserRoleHierarchySchema = z.object({
1795
+ roleName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Role API name"),
1796
+ label: z.string().min(1).describe("Role display label"),
1797
+ parentRoleName: z.string().optional().describe("Parent role API name (omit for top-level)"),
1798
+ caseAccessLevel: z.enum(["None","Read","Edit","ReadWrite"]).default("ReadWrite").describe("Case access for subordinates"),
1799
+ contactAccessLevel: z.enum(["None","Read","Edit","ReadWrite"]).default("ReadWrite").describe("Contact access for subordinates"),
1800
+ opportunityAccessLevel: z.enum(["None","Read","Edit","ReadWrite"]).default("ReadWrite").describe("Opportunity access for subordinates"),
1801
+ accountAccessLevel: z.enum(["None","Read","Edit","ReadWrite"]).default("ReadWrite").describe("Account access for subordinates"),
1802
+ mayForecastManagerShare: z.boolean().default(true).describe("Grant manager forecast sharing"),
1803
+ description: z.string().optional().describe("Role description"),
1804
+ }).strict();
1805
+ export const ResetUserPasswordSchema = z.object({
1806
+ username: z.string().min(1).describe("Salesforce username of the user to reset"),
1807
+ sendEmail: z.boolean().default(true).describe("Send password reset email to the user"),
1808
+ }).strict();
1809
+ export const FreezeUserSchema = z.object({
1810
+ username: z.string().min(1).describe("Salesforce username to freeze or unfreeze"),
1811
+ freeze: z.boolean().describe("true to freeze, false to unfreeze"),
1812
+ }).strict();
1813
+ export const CreateETMTerritorySchema = z.object({
1814
+ territoryName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Territory API name"),
1815
+ label: z.string().min(1).describe("Territory display label"),
1816
+ territoryType: z.string().min(1).describe("Territory2Type API name (must exist in org)"),
1817
+ parentTerritoryName: z.string().optional().describe("Parent territory name for hierarchy"),
1818
+ accountAccessLevel: z.enum(["View","Edit","All","None"]).default("View").describe("Account access for territory members"),
1819
+ opportunityAccessLevel: z.enum(["View","Edit","All","None"]).default("View").describe("Opportunity access"),
1820
+ caseAccessLevel: z.enum(["View","Edit","All","None"]).default("View").describe("Case access"),
1821
+ description: z.string().optional().describe("Territory description"),
1822
+ }).strict();
1823
+ export const AssignTerritoryToUserSchema = z.object({
1824
+ territoryName: z.string().min(1).describe("Territory API name to assign user to"),
1825
+ username: z.string().min(1).describe("Salesforce username to assign"),
1826
+ roleInTerritory: z.enum(["Salesperson","AccountManager","Owner"]).default("Salesperson").describe("User role within the territory"),
1827
+ }).strict();
1828
+ export const CreateForecastHierarchySchema = z.object({
1829
+ forecastingType: z.enum(["OpportunityRevenue","OpportunityQuantity","OverlayRevenue","OverlayQuantity","ProductFamily"]).describe("Forecasting type"),
1830
+ displayCurrency: z.string().default("USD").describe("Currency code for display (e.g. 'USD', 'EUR')"),
1831
+ isActive: z.boolean().default(true).describe("Enable this forecasting type"),
1832
+ }).strict();
1833
+ export const DeleteCustomObjectSchema = z.object({
1834
+ objectApiName: z.string().min(1).describe("Custom object API name to delete (e.g. 'MyObject__c')"),
1835
+ confirmDelete: z.boolean().describe("Must be true to confirm deletion — this is permanent and deletes all data"),
1836
+ }).strict();
1837
+ export const DeleteCustomFieldSchema = z.object({
1838
+ objectApiName: z.string().min(1).describe("Object API name containing the field"),
1839
+ fieldApiName: z.string().min(1).describe("Field API name to delete (e.g. 'MyField__c')"),
1840
+ confirmDelete: z.boolean().describe("Must be true to confirm deletion — this is permanent"),
1841
+ }).strict();
1842
+ export const CreateRollupSummaryFieldSchema = z.object({
1843
+ objectApiName: z.string().min(1).describe("Master object API name to add the rollup field to"),
1844
+ fieldName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Field API name (without __c)"),
1845
+ label: z.string().min(1).describe("Field display label"),
1846
+ summaryObject: z.string().min(1).describe("Child (detail) object API name, e.g. 'Opportunity'"),
1847
+ summaryType: z.enum(["COUNT","SUM","MIN","MAX"]).describe("Aggregation type"),
1848
+ aggregatedField: z.string().optional().describe("Child field to aggregate (required for SUM/MIN/MAX, e.g. 'Amount')"),
1849
+ filterCriteria: z.array(z.object({
1850
+ field: z.string().describe("Child field API name"),
1851
+ operator: z.enum(["equals","notEqual","lessThan","greaterThan","lessOrEqual","greaterOrEqual","contains","notContain","startsWith"]).describe("Filter operator"),
1852
+ value: z.string().describe("Filter value"),
1853
+ })).optional().describe("Filter criteria to limit which child records are included"),
1854
+ description: z.string().optional().describe("Field description"),
1855
+ }).strict();
1856
+ export const CreateExternalIdFieldSchema = z.object({
1857
+ objectApiName: z.string().min(1).describe("Object API name to add the field to"),
1858
+ fieldName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Field API name (without __c)"),
1859
+ label: z.string().min(1).describe("Field display label"),
1860
+ fieldType: z.enum(["Text","Number","Email","AutoNumber"]).default("Text").describe("Field data type"),
1861
+ isUnique: z.boolean().default(true).describe("Enforce unique values"),
1862
+ isCaseSensitive: z.boolean().default(false).describe("Case-sensitive uniqueness enforcement (Text only)"),
1863
+ length: z.number().int().default(80).describe("Field length (Text fields only)"),
1864
+ description: z.string().optional().describe("Field description"),
1865
+ }).strict();
1866
+ export const EnableObjectFeaturesSchema = z.object({
1867
+ objectApiName: z.string().min(1).describe("Custom object API name"),
1868
+ enableHistory: z.boolean().optional().describe("Enable field history tracking"),
1869
+ enableFeeds: z.boolean().optional().describe("Enable Chatter feeds on records"),
1870
+ enableSearch: z.boolean().optional().describe("Allow records to appear in search results"),
1871
+ enableReports: z.boolean().optional().describe("Allow this object to be used in reports"),
1872
+ enableActivities: z.boolean().optional().describe("Enable activities (tasks and events) on records"),
1873
+ enableBulkApi: z.boolean().optional().describe("Enable Bulk API access"),
1874
+ }).strict();
1875
+ export const UpdateFlowSchema = z.object({
1876
+ flowApiName: z.string().min(1).describe("Flow API name to update"),
1877
+ newLabel: z.string().optional().describe("New display label for the flow"),
1878
+ newDescription: z.string().optional().describe("New description for the flow"),
1879
+ variablesToAdd: z.array(z.object({
1880
+ name: z.string().min(1).describe("Variable API name"),
1881
+ dataType: z.enum(["String","Number","Currency","Boolean","Date","DateTime","SObject","Apex","Multipicklist","Picklist"]).describe("Variable data type"),
1882
+ isInput: z.boolean().default(false).describe("Available for input"),
1883
+ isOutput: z.boolean().default(false).describe("Available for output"),
1884
+ objectType: z.string().optional().describe("SObject API name (for SObject dataType)"),
1885
+ defaultValue: z.string().optional().describe("Default value expression"),
1886
+ })).optional().describe("Variables to add to the flow"),
1887
+ }).strict();
1888
+ export const CloneFlowSchema = z.object({
1889
+ sourceFlowApiName: z.string().min(1).describe("Source flow API name to clone"),
1890
+ newFlowApiName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("New flow API name"),
1891
+ newLabel: z.string().min(1).describe("New flow display label"),
1892
+ activateImmediately: z.boolean().default(false).describe("Activate the cloned flow immediately"),
1893
+ }).strict();
1894
+ export const CreateFlowTestSchema = z.object({
1895
+ flowApiName: z.string().min(1).describe("Flow API name to test"),
1896
+ testName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Test definition API name"),
1897
+ label: z.string().min(1).describe("Test display label"),
1898
+ description: z.string().optional().describe("Test description"),
1899
+ inputs: z.array(z.object({
1900
+ name: z.string().describe("Variable name"),
1901
+ value: z.string().describe("Input value (as string)"),
1902
+ })).optional().describe("Input variable values for the test"),
1903
+ expectedOutputs: z.array(z.object({
1904
+ name: z.string().describe("Variable name"),
1905
+ expectedValue: z.string().describe("Expected output value"),
1906
+ })).optional().describe("Expected output assertions"),
1907
+ }).strict();
1908
+ export const CreateInvocableActionSchema = z.object({
1909
+ actionName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Apex class name for the action"),
1910
+ label: z.string().min(1).describe("Action display label"),
1911
+ apexMethodName: z.string().default("execute").describe("Apex method name annotated with @InvocableMethod"),
1912
+ description: z.string().optional().describe("Action description"),
1913
+ inputs: z.array(z.object({
1914
+ name: z.string().min(1).describe("Input variable name"),
1915
+ label: z.string().min(1).describe("Input variable label"),
1916
+ dataType: z.enum(["String","Integer","Long","Double","Boolean","Date","Datetime","Id","sObject"]).describe("Data type"),
1917
+ required: z.boolean().default(false).describe("Is input required"),
1918
+ sObjectType: z.string().optional().describe("SObject API name if dataType=sObject"),
1919
+ })).default([]).describe("Input parameters"),
1920
+ outputs: z.array(z.object({
1921
+ name: z.string().min(1).describe("Output variable name"),
1922
+ label: z.string().min(1).describe("Output variable label"),
1923
+ dataType: z.enum(["String","Integer","Long","Double","Boolean","Date","Datetime","Id","sObject"]).describe("Data type"),
1924
+ sObjectType: z.string().optional().describe("SObject API name if dataType=sObject"),
1925
+ })).default([]).describe("Output parameters"),
1926
+ }).strict();
1927
+ export const SearchApexSchema = z.object({
1928
+ searchTerm: z.string().min(1).describe("Text to search for in Apex code"),
1929
+ searchIn: z.enum(["Classes","Triggers","Both"]).default("Both").describe("Where to search"),
1930
+ caseSensitive: z.boolean().default(false).describe("Case-sensitive search"),
1931
+ limit: z.number().int().default(50).describe("Maximum number of results"),
1932
+ }).strict();
1933
+ export const GetApexLogsSchema = z.object({
1934
+ username: z.string().optional().describe("Filter logs by Salesforce username"),
1935
+ limit: z.number().int().min(1).max(100).default(10).describe("Maximum number of logs to return"),
1936
+ operation: z.string().optional().describe("Filter by operation name (e.g. '/apex/mypage', 'execute_anonymous_apex')"),
1937
+ }).strict();
1938
+ export const GetApexLogBodySchema = z.object({
1939
+ logId: z.string().min(15).max(18).describe("Apex debug log ID (from sf_get_apex_logs)"),
1940
+ }).strict();
1941
+ export const CreateApexBatchSchema = z.object({
1942
+ className: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Apex batch class name"),
1943
+ sObjectType: z.string().min(1).describe("SObject type to query and process, e.g. 'Account'"),
1944
+ queryFilter: z.string().optional().describe("SOQL WHERE clause for start method, e.g. \"CreatedDate = TODAY\""),
1945
+ batchSize: z.number().int().default(200).describe("Batch size (records per execute call, 1-2000)"),
1946
+ description: z.string().optional().describe("Class description / what the batch does"),
1947
+ implementsStateful: z.boolean().default(false).describe("Implement Database.Stateful to maintain state between batches"),
1948
+ additionalCode: z.string().optional().describe("Additional Apex code to include in the execute method body"),
1949
+ }).strict();
1950
+ export const CreateApexSchedulerSchema = z.object({
1951
+ className: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Apex schedulable class name"),
1952
+ jobName: z.string().min(1).describe("Default schedule job name"),
1953
+ cronExpression: z.string().default("0 0 2 * * ?").describe("Default cron expression, e.g. '0 0 2 * * ?' (daily at 2am)"),
1954
+ batchClassName: z.string().optional().describe("Batch class to execute (if this scheduler runs a batch)"),
1955
+ description: z.string().optional().describe("Class description"),
1956
+ }).strict();
1957
+ export const RollbackDeploymentSchema = z.object({
1958
+ deploymentId: z.string().min(15).describe("Deployment job ID to cancel or roll back"),
1959
+ }).strict();
1960
+ export const CreateScratchOrgSchema = z.object({
1961
+ orgAlias: z.string().min(1).regex(/^[A-Za-z0-9_-]+$/).describe("Alias for the new scratch org"),
1962
+ devHubAlias: z.string().default("DevHub").describe("SF CLI alias for the Dev Hub org"),
1963
+ duration: z.number().int().min(1).max(30).default(7).describe("Scratch org lifetime in days (1–30)"),
1964
+ features: z.array(z.string()).default([]).describe("Scratch org features, e.g. ['Communities', 'ServiceCloud']"),
1965
+ edition: z.enum(["Developer","Enterprise","Group","Professional"]).default("Developer").describe("Scratch org edition"),
1966
+ adminEmail: z.string().optional().describe("Admin email for the scratch org"),
1967
+ description: z.string().optional().describe("Description for the scratch org"),
1968
+ }).strict();
1969
+ export const CreateSandboxSchema = z.object({
1970
+ sandboxName: z.string().min(1).max(10).regex(/^[A-Za-z][A-Za-z0-9]*$/).describe("Sandbox name (max 10 chars, alphanumeric)"),
1971
+ sandboxType: z.enum(["Developer","Developer_Pro","Partial","Full"]).describe("Sandbox type/license"),
1972
+ description: z.string().optional().describe("Sandbox description"),
1973
+ autoActivate: z.boolean().default(true).describe("Auto-activate after creation"),
1974
+ apexClassId: z.string().optional().describe("Apex class ID to run after sandbox copy (post-copy script)"),
1975
+ sourceSandboxName: z.string().optional().describe("Source sandbox to copy from (Full/Partial only; defaults to production)"),
1976
+ }).strict();
1977
+ export const RefreshSandboxSchema = z.object({
1978
+ sandboxName: z.string().min(1).describe("Name of the sandbox to refresh"),
1979
+ autoActivate: z.boolean().default(true).describe("Auto-activate after refresh completes"),
1980
+ apexClassId: z.string().optional().describe("Apex class ID to run after refresh (post-copy script)"),
1981
+ }).strict();
1982
+ export const ExportPackageXmlSchema = z.object({
1983
+ metadataTypes: z.array(z.string()).default([]).describe("Metadata types to include. Empty array = all common types (ApexClass, CustomObject, Flow, PermissionSet, etc.)"),
1984
+ includeManaged: z.boolean().default(false).describe("Include managed package components"),
1985
+ apiVersion: z.string().optional().describe("API version for the package.xml (defaults to current API_VERSION)"),
1986
+ }).strict();
1987
+ export const CreateExperienceContainerSchema = z.object({
1988
+ pageName: z.string().min(1).describe("FlexiPage API name to add the container to"),
1989
+ containerName: z.string().min(1).describe("Container component name"),
1990
+ region: z.string().default("main").describe("Region to place the container in"),
1991
+ order: z.number().int().default(0).describe("Order within the region"),
1992
+ properties: z.array(z.object({ name: z.string(), value: z.string() })).optional().describe("Container component properties"),
1993
+ }).strict();
1994
+ export const SetExperienceSiteLoginSchema = z.object({
1995
+ siteName: z.string().min(1).describe("Experience Cloud site URL suffix or API name"),
1996
+ selfRegistrationEnabled: z.boolean().default(false).describe("Allow users to self-register"),
1997
+ selfRegistrationProfileName: z.string().optional().describe("Default profile for self-registered users"),
1998
+ forgotPasswordEnabled: z.boolean().default(true).describe("Show forgot password link"),
1999
+ loginPageType: z.enum(["Standard","Custom"]).default("Standard").describe("Standard Salesforce login or custom login page"),
2000
+ customLoginUrl: z.string().optional().describe("Custom login page URL (for Custom loginPageType)"),
2001
+ }).strict();
2002
+ export const CreateCmsContentSchema = z.object({
2003
+ contentName: z.string().min(1).max(255).describe("CMS content name"),
2004
+ contentType: z.enum(["News","Document","Image","custom"]).describe("CMS content type"),
2005
+ language: z.string().default("en_US").describe("Content language locale, e.g. 'en_US'"),
2006
+ fields: z.record(z.string()).describe("Content field key-value pairs, e.g. {title: 'My Title', body: 'Content...'}"),
2007
+ channelNames: z.array(z.string()).optional().describe("Experience Cloud site names to publish content to"),
2008
+ }).strict();
2009
+ export const ExportRecordsSchema = z.object({
2010
+ query: z.string().min(1).describe("Full SOQL query string"),
2011
+ includeHeaders: z.boolean().default(true).describe("Include CSV header row"),
2012
+ limit: z.number().int().default(2000).describe("Maximum records to export"),
2013
+ }).strict();
2014
+ export const UpsertRecordSchema = z.object({
2015
+ objectApiName: z.string().min(1).describe("SObject API name, e.g. 'Account'"),
2016
+ externalIdField: z.string().min(1).describe("External ID field API name, e.g. 'My_External_Id__c'"),
2017
+ externalIdValue: z.string().min(1).describe("Value of the external ID to match on"),
2018
+ fields: z.record(z.unknown()).describe("Field key-value pairs to set/update"),
2019
+ }).strict();
2020
+ export const GetRecordSchema = z.object({
2021
+ objectApiName: z.string().min(1).describe("SObject API name, e.g. 'Account'"),
2022
+ recordId: z.string().min(15).max(18).describe("Record ID"),
2023
+ fields: z.array(z.string()).optional().describe("Field API names to retrieve. Empty = all available fields"),
2024
+ }).strict();
2025
+ export const SearchRecordsSchema = z.object({
2026
+ searchTerm: z.string().min(1).describe("Search term (SOSL FIND clause value, no quotes needed)"),
2027
+ objects: z.array(z.object({
2028
+ objectName: z.string().describe("SObject API name"),
2029
+ fields: z.array(z.string()).describe("Fields to return"),
2030
+ })).default([{ objectName: "Account", fields: ["Id","Name"] }, { objectName: "Contact", fields: ["Id","Name","Email"] }]).describe("Objects to search across"),
2031
+ limit: z.number().int().default(20).describe("Maximum results per object"),
2032
+ }).strict();
2033
+ export const CreatePlatformEventSubscriptionSchema = z.object({
2034
+ eventApiName: z.string().min(1).describe("Platform event API name, e.g. 'My_Event__e'"),
2035
+ subscriptionType: z.enum(["Trigger","Flow"]).describe("Subscribe via Apex trigger or Flow"),
2036
+ subscriberName: z.string().min(1).describe("API name of the trigger or flow to create/reference"),
2037
+ apexCode: z.string().optional().describe("Apex trigger body (for Trigger type). Auto-generated if omitted."),
2038
+ }).strict();
2039
+ export const CreateChangedDataCaptureSchema = z.object({
2040
+ objectApiName: z.string().min(1).describe("Object API name to enable CDC for, e.g. 'Account', 'Contact', 'My_Object__c'"),
2041
+ enabled: z.boolean().default(true).describe("Enable or disable CDC for this object"),
2042
+ }).strict();
2043
+ export const CreateRestResourceSchema = z.object({
2044
+ resourceName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Apex class name for the REST resource"),
2045
+ urlMapping: z.string().min(1).describe("URL mapping, e.g. '/myresource/*' or '/accounts/:id'"),
2046
+ description: z.string().optional().describe("Resource description"),
2047
+ methods: z.array(z.object({
2048
+ httpMethod: z.enum(["GET","POST","PUT","DELETE","PATCH"]).describe("HTTP method"),
2049
+ description: z.string().optional().describe("Method description"),
2050
+ apexCode: z.string().optional().describe("Method body code (returns empty implementation if omitted)"),
2051
+ })).min(1).describe("HTTP methods to implement"),
2052
+ }).strict();
2053
+ export const GetOrgLimitsSchema = z.object({
2054
+ filter: z.string().optional().describe("Optional filter string — return only limits whose name contains this text (e.g. 'Api', 'Storage', 'Scratch')"),
2055
+ }).strict();
2056
+ export const GetFlowErrorsSchema = z.object({
2057
+ flowApiName: z.string().optional().describe("Filter to a specific flow API name (optional)"),
2058
+ hoursBack: z.number().int().default(24).describe("Look back this many hours for errors"),
2059
+ limit: z.number().int().default(50).describe("Maximum error records to return"),
2060
+ }).strict();
2061
+ export const GetApexTestResultsSchema = z.object({
2062
+ testRunId: z.string().optional().describe("Specific test run ID (from sf_run_apex_tests). Omit to get latest run."),
2063
+ className: z.string().optional().describe("Filter to a specific Apex test class"),
2064
+ outcomeFilter: z.enum(["Pass","Fail","CompileFail","Skip","all"]).default("all").describe("Filter by outcome"),
2065
+ }).strict();
2066
+ export const GetDeploymentHistorySchema = z.object({
2067
+ limit: z.number().int().default(10).describe("Maximum deployments to return"),
2068
+ status: z.enum(["Succeeded","Failed","Pending","InProgress","Canceling","all"]).default("all").describe("Filter by deployment status"),
2069
+ }).strict();
2070
+ export const CreateAgentChannelSchema = z.object({
2071
+ agentApiName: z.string().min(1).describe("Agentforce agent (Bot) API name"),
2072
+ channelType: z.enum(["Messaging","Chat","Embedded","Voice"]).describe("Channel type to configure"),
2073
+ channelName: z.string().min(1).describe("Existing channel API name (MessagingChannel for Messaging, LiveChatButton for Chat)"),
2074
+ routingType: z.enum(["Queue","Agent","Bot"]).default("Bot").describe("Routing type — Bot routes to agent first, then escalates"),
2075
+ queueName: z.string().optional().describe("Queue name for escalation (recommended when routingType=Bot)"),
2076
+ }).strict();
2077
+ export const CloneAgentSchema = z.object({
2078
+ sourceAgentApiName: z.string().min(1).describe("Source agent (Bot) API name to clone"),
2079
+ newAgentApiName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("New agent API name"),
2080
+ newLabel: z.string().min(1).describe("New agent display label"),
2081
+ includeTopics: z.boolean().default(true).describe("Clone the agent's topics (GenAiPlugins)"),
2082
+ includeActions: z.boolean().default(true).describe("Clone the agent's actions (GenAiFunctions) — requires includeTopics=true"),
2083
+ }).strict();
2084
+ export const ExportAgentSchema = z.object({
2085
+ agentApiName: z.string().min(1).describe("Agent (Bot) API name to export"),
2086
+ }).strict();
2087
+ export const ExportOmniStudioComponentSchema = z.object({
2088
+ componentType: z.enum(["FlexCard","OmniScript","DataRaptor","IntegrationProcedure"]).describe("Component type to export"),
2089
+ componentName: z.string().min(1).describe("Component API name"),
2090
+ subType: z.string().optional().describe("Sub-type (required for OmniScript and IntegrationProcedure: the subType portion of the fullName)"),
2091
+ language: z.string().default("English").describe("Language (for OmniScript, e.g. 'English')"),
2092
+ }).strict();
2093
+ export const ImportOmniStudioComponentSchema = z.object({
2094
+ componentType: z.enum(["FlexCard","OmniScript","DataRaptor","IntegrationProcedure"]).describe("Component type to import"),
2095
+ newName: z.string().min(1).describe("New API name for the imported component (must differ from source)"),
2096
+ jsonDefinition: z.string().min(1).describe("JSON string exported by sf_export_omnistudio_component"),
2097
+ activate: z.boolean().default(false).describe("Activate the component after import"),
2098
+ }).strict();
2099
+ export const CreateDocumentGenerationSchema = z.object({
2100
+ templateName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Template API name"),
2101
+ label: z.string().min(1).describe("Template display label"),
2102
+ objectApiName: z.string().min(1).describe("Context object API name, e.g. 'Account'"),
2103
+ templateType: z.enum(["Word","PDF","Excel"]).default("Word").describe("Output document format"),
2104
+ dataSourceType: z.enum(["DataRaptor","IntegrationProcedure"]).default("DataRaptor").describe("Data source type"),
2105
+ dataSourceName: z.string().min(1).describe("DataRaptor or Integration Procedure API name to feed data"),
2106
+ description: z.string().optional().describe("Template description"),
2107
+ }).strict();
1793
2108
  //# sourceMappingURL=index.js.map