@salesforce/mcp 0.17.1-dev.0 → 0.17.2-dev.1

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.
Files changed (86) hide show
  1. package/lib/index.d.ts +1 -1
  2. package/lib/index.js +7 -88
  3. package/lib/main-server-provider.d.ts +7 -0
  4. package/lib/main-server-provider.js +31 -0
  5. package/lib/registry.d.ts +3 -0
  6. package/lib/{tools/core/index.js → registry.js} +11 -4
  7. package/lib/scripts/build-index.js +1 -1
  8. package/lib/services.d.ts +12 -0
  9. package/lib/services.js +34 -0
  10. package/lib/sf-mcp-server.d.ts +12 -7
  11. package/lib/sf-mcp-server.js +6 -20
  12. package/lib/telemetry.d.ts +2 -1
  13. package/lib/tools/sf-enable-tools.d.ts +23 -0
  14. package/lib/tools/sf-enable-tools.js +77 -0
  15. package/lib/tools/sf-list-tools.d.ts +8 -0
  16. package/lib/tools/{dynamic/sf-list-tools.js → sf-list-tools.js} +33 -9
  17. package/lib/tools/sf-suggest-cli-command.d.ts +25 -0
  18. package/lib/tools/{core/sf-suggest-cli-command.js → sf-suggest-cli-command.js} +46 -18
  19. package/lib/utils/assets.d.ts +21 -0
  20. package/lib/{assets.js → utils/assets.js} +23 -33
  21. package/lib/{shared → utils}/auth.d.ts +3 -8
  22. package/lib/{shared → utils}/auth.js +2 -42
  23. package/lib/utils/registry-utils.d.ts +4 -0
  24. package/lib/utils/registry-utils.js +87 -0
  25. package/lib/utils/tools.d.ts +41 -0
  26. package/lib/{shared → utils}/tools.js +0 -69
  27. package/lib/utils/types.d.ts +5 -0
  28. package/package.json +8 -6
  29. package/README.md +0 -263
  30. package/lib/assets.d.ts +0 -44
  31. package/lib/shared/params.d.ts +0 -5
  32. package/lib/shared/params.js +0 -46
  33. package/lib/shared/tools.d.ts +0 -68
  34. package/lib/shared/types.d.ts +0 -33
  35. package/lib/shared/utils.d.ts +0 -11
  36. package/lib/shared/utils.js +0 -71
  37. package/lib/tools/core/index.d.ts +0 -3
  38. package/lib/tools/core/sf-get-username.d.ts +0 -17
  39. package/lib/tools/core/sf-get-username.js +0 -109
  40. package/lib/tools/core/sf-resume.d.ts +0 -20
  41. package/lib/tools/core/sf-resume.js +0 -149
  42. package/lib/tools/core/sf-suggest-cli-command.d.ts +0 -5
  43. package/lib/tools/data/index.d.ts +0 -1
  44. package/lib/tools/data/index.js +0 -17
  45. package/lib/tools/data/sf-query-org.d.ts +0 -20
  46. package/lib/tools/data/sf-query-org.js +0 -66
  47. package/lib/tools/dynamic/index.d.ts +0 -2
  48. package/lib/tools/dynamic/index.js +0 -18
  49. package/lib/tools/dynamic/sf-enable-tools.d.ts +0 -2
  50. package/lib/tools/dynamic/sf-enable-tools.js +0 -42
  51. package/lib/tools/dynamic/sf-list-tools.d.ts +0 -2
  52. package/lib/tools/metadata/index.d.ts +0 -2
  53. package/lib/tools/metadata/index.js +0 -18
  54. package/lib/tools/metadata/sf-deploy-metadata.d.ts +0 -27
  55. package/lib/tools/metadata/sf-deploy-metadata.js +0 -164
  56. package/lib/tools/metadata/sf-retrieve-metadata.d.ts +0 -2
  57. package/lib/tools/metadata/sf-retrieve-metadata.js +0 -128
  58. package/lib/tools/orgs/index.d.ts +0 -5
  59. package/lib/tools/orgs/index.js +0 -21
  60. package/lib/tools/orgs/sf-create-org-snapshot.d.ts +0 -23
  61. package/lib/tools/orgs/sf-create-org-snapshot.js +0 -88
  62. package/lib/tools/orgs/sf-create-scratch-org.d.ts +0 -50
  63. package/lib/tools/orgs/sf-create-scratch-org.js +0 -132
  64. package/lib/tools/orgs/sf-delete-org.d.ts +0 -14
  65. package/lib/tools/orgs/sf-delete-org.js +0 -65
  66. package/lib/tools/orgs/sf-list-all-orgs.d.ts +0 -11
  67. package/lib/tools/orgs/sf-list-all-orgs.js +0 -59
  68. package/lib/tools/orgs/sf-org-open.d.ts +0 -17
  69. package/lib/tools/orgs/sf-org-open.js +0 -57
  70. package/lib/tools/testing/index.d.ts +0 -2
  71. package/lib/tools/testing/index.js +0 -18
  72. package/lib/tools/testing/sf-test-agents.d.ts +0 -21
  73. package/lib/tools/testing/sf-test-agents.js +0 -84
  74. package/lib/tools/testing/sf-test-apex.d.ts +0 -40
  75. package/lib/tools/testing/sf-test-apex.js +0 -132
  76. package/lib/tools/users/index.d.ts +0 -1
  77. package/lib/tools/users/index.js +0 -17
  78. package/lib/tools/users/sf-assign-permission-set.d.ts +0 -20
  79. package/lib/tools/users/sf-assign-permission-set.js +0 -89
  80. package/lib/tsconfig.tsbuildinfo +0 -1
  81. package/npm-shrinkwrap.json +0 -18827
  82. /package/lib/{shared → utils}/cache.d.ts +0 -0
  83. /package/lib/{shared → utils}/cache.js +0 -0
  84. /package/lib/{shared → utils}/rate-limiter.d.ts +0 -0
  85. /package/lib/{shared → utils}/rate-limiter.js +0 -0
  86. /package/lib/{shared → utils}/types.js +0 -0
@@ -1,109 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { z } from 'zod';
17
- import { textResponse } from '../../shared/utils.js';
18
- import { getDefaultTargetOrg, getDefaultTargetDevHub, suggestUsername } from '../../shared/auth.js';
19
- import { directoryParam } from '../../shared/params.js';
20
- /*
21
- * Get username for Salesforce org
22
- *
23
- * Intelligently determines the appropriate username or alias for Salesforce operations.
24
- *
25
- * Parameters:
26
- * - defaultTargetOrg: Force lookup of default target org (optional)
27
- * - defaultDevHub: Force lookup of default dev hub (optional)
28
- * - directory: The directory to run this tool from
29
- *
30
- * Returns:
31
- * - textResponse: Username/alias and org configuration
32
- */
33
- export const getUsernameParamsSchema = z.object({
34
- defaultTargetOrg: z.boolean().optional().default(false).describe(`Try to find default org
35
- AGENT INSTRUCTIONS:
36
- ONLY SET TO TRUE when the user explicitly asks for the default org or default target org.
37
- Leave it as false when the user is vague and says something like "for my org" or "for my-alias".
38
-
39
- USAGE EXAMPLE:
40
- Get username for my default org
41
- ...for my default target org`),
42
- defaultDevHub: z.boolean().optional().default(false).describe(`Try to find default dev hub
43
- AGENT INSTRUCTIONS:
44
- ONLY SET TO TRUE when the user explicitly asks for the default dev hub or default target devhub.
45
- Leave it as false when the user is vague and says something like "for my org" or "for my-alias".
46
-
47
- USAGE EXAMPLE:
48
- Get username for my default dev hub
49
- ...for my default target dev hub
50
- ...for my default devhub`),
51
- directory: directoryParam,
52
- });
53
- export const registerToolGetUsername = (server) => {
54
- server.tool('sf-get-username', `Intelligently determines the appropriate username or alias for Salesforce operations.
55
-
56
- AGENT/LLM INSTRUCTIONS:
57
- Use this tool when uncertain which username/org a user wants for Salesforce operations.
58
- This tool handles three distinct scenarios:
59
-
60
- 1. When defaultTargetOrg=true: Fetches the default target org configuration
61
- - Use when user says "for my default org" or "for my default target org"
62
-
63
- 2. When defaultDevHub=true: Fetches the default dev hub configuration
64
- - Use when user says "for my default dev hub" or "for my default target dev hub"
65
-
66
- 3. When both are false (default): Uses suggestUsername to intelligently determine the appropriate org
67
- - Use when user is vague and says something like "for my org" or doesn't specify
68
-
69
- EXAMPLE USAGE:
70
- - When user says "Do X for my org" → defaultTargetOrg=false, defaultDevHub=false
71
- - When user says "For my default org" → defaultTargetOrg=true
72
- - When user says "For my default dev hub" → defaultDevHub=true`, getUsernameParamsSchema.shape, {
73
- title: 'Get Username',
74
- readOnlyHint: true,
75
- openWorldHint: false,
76
- }, async ({ defaultTargetOrg, defaultDevHub, directory }) => {
77
- try {
78
- process.chdir(directory);
79
- const generateResponse = (defaultFromConfig) => textResponse(`ALWAYS notify the user the following 3 (maybe 4) pieces of information:
80
- 1. If it is default target-org or target-dev-hub ('.key' on the config)
81
- 2. The value of '.location' on the config
82
- 3. The value of '.value' on the config
83
- 4. IF '.cached' IS TRUE, tell then we are using a cached value and if they have changed it, restart the MCP Server
84
-
85
- - Full config: ${JSON.stringify(defaultFromConfig, null, 2)}
86
-
87
- UNLESS THE USER SPECIFIES OTHERWISE, use this username for the "usernameOrAlias" parameter in future Tool calls.`);
88
- // Case 1: User explicitly asked for default target org
89
- if (defaultTargetOrg)
90
- return generateResponse(await getDefaultTargetOrg());
91
- // Case 2: User explicitly asked for default dev hub
92
- if (defaultDevHub)
93
- return generateResponse(await getDefaultTargetDevHub());
94
- // Case 3: User was vague, so suggest a username
95
- const { aliasForReference, suggestedUsername, reasoning } = await suggestUsername();
96
- if (!suggestedUsername) {
97
- return textResponse("No suggested username found. Please specify a username or alias explicitly. Also check the MCP server's startup args for allowlisting orgs.", true);
98
- }
99
- return textResponse(`
100
- YOU MUST inform the user that we are going to use "${suggestedUsername}" ${aliasForReference ? `(Alias: ${aliasForReference}) ` : ''}for the "usernameOrAlias" parameter.
101
- YOU MUST explain the reasoning for selecting this org, which is: "${reasoning}"
102
- UNLESS THE USER SPECIFIES OTHERWISE, use this username for the "usernameOrAlias" parameter in future Tool calls.`);
103
- }
104
- catch (error) {
105
- return textResponse(`Failed to determine appropriate username: ${error instanceof Error ? error.message : 'Unknown error'}`, true);
106
- }
107
- });
108
- };
109
- //# sourceMappingURL=sf-get-username.js.map
@@ -1,20 +0,0 @@
1
- import { z } from 'zod';
2
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- export declare const resumeParamsSchema: z.ZodObject<{
4
- jobId: z.ZodString;
5
- wait: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
- usernameOrAlias: z.ZodString;
7
- directory: z.ZodEffects<z.ZodString, string, string>;
8
- }, "strip", z.ZodTypeAny, {
9
- directory: string;
10
- jobId: string;
11
- wait: number;
12
- usernameOrAlias: string;
13
- }, {
14
- directory: string;
15
- jobId: string;
16
- usernameOrAlias: string;
17
- wait?: number | undefined;
18
- }>;
19
- export type ResumeParamsSchema = z.infer<typeof resumeParamsSchema>;
20
- export declare const registerToolResume: (server: McpServer) => void;
@@ -1,149 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { z } from 'zod';
17
- import { AgentTester } from '@salesforce/agents';
18
- import { validateSalesforceId, scratchOrgResume, PollingClient } from '@salesforce/core';
19
- import { Duration } from '@salesforce/kit';
20
- import { MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
21
- import { textResponse } from '../../shared/utils.js';
22
- import { directoryParam, usernameOrAliasParam } from '../../shared/params.js';
23
- import { getConnection } from '../../shared/auth.js';
24
- const resumableIdPrefixes = new Map([
25
- ['deploy', '0Af'],
26
- ['scratchOrg', '2SR'],
27
- ['agentTest', '4KB'],
28
- ['orgSnapshot', '0Oo'],
29
- ]);
30
- /*
31
- * Resume a long running operation that was not completed by another tool.
32
- *
33
- * Intelligently determines the appropriate username or alias for Salesforce operations.
34
- *
35
- * Parameters:
36
- * - jobId: The job id of the long running operation to resume (required)
37
- * - wait: The amount of time to wait for the operation to complete in minutes (optional)
38
- * - defaultTargetOrg: Force lookup of default target org (optional)
39
- * - directory: The directory to run this tool from
40
- *
41
- * Returns:
42
- * - textResponse: Username/alias and org configuration
43
- */
44
- export const resumeParamsSchema = z.object({
45
- jobId: z.string().describe('The job id of the long running operation to resume (required)'),
46
- wait: z
47
- .number()
48
- .optional()
49
- .default(30)
50
- .describe('The amount of time to wait for the operation to complete in minutes (optional)'),
51
- usernameOrAlias: usernameOrAliasParam,
52
- directory: directoryParam,
53
- });
54
- export const registerToolResume = (server) => {
55
- server.tool('sf-resume', `Resume a long running operation that was not completed by another tool.
56
-
57
- AGENT INSTRUCTIONS:
58
- Use this tool to resume a long running operation.
59
-
60
- EXAMPLE USAGE:
61
- Resume the metadata deploy job 0Af1234567890
62
- Resume the deployment and wait for 10 minutes
63
- Resume the deployment to my org
64
- Resume scratch org creation
65
- Resume job 2SR1234567890
66
- Resume agent tests
67
- Resume org snapshot with ID 0OoKa000000XZAbKAO
68
- Report on my org snapshot
69
- `, resumeParamsSchema.shape, {
70
- title: 'Resume',
71
- openWorldHint: false,
72
- }, async ({ jobId, wait, usernameOrAlias, directory }) => {
73
- if (!jobId) {
74
- return textResponse('The jobId parameter is required.', true);
75
- }
76
- if (!validateSalesforceId(jobId)) {
77
- return textResponse('The jobId parameter is not a valid Salesforce id.', true);
78
- }
79
- if (!usernameOrAlias)
80
- return textResponse('The usernameOrAlias parameter is required, if the user did not specify one use the #sf-get-username tool', true);
81
- process.chdir(directory);
82
- const connection = await getConnection(usernameOrAlias);
83
- switch (jobId.substring(0, 3)) {
84
- case resumableIdPrefixes.get('deploy'):
85
- return resumeDeployment(connection, jobId, wait);
86
- case resumableIdPrefixes.get('scratchOrg'):
87
- return resumeScratchOrg(jobId, wait);
88
- case resumableIdPrefixes.get('agentTest'):
89
- return resumeAgentTest(connection, jobId, wait);
90
- case resumableIdPrefixes.get('orgSnapshot'):
91
- return resumeOrgSnapshot(connection, jobId, wait);
92
- default:
93
- return textResponse(`The job id: ${jobId} is not resumeable.`, true);
94
- }
95
- });
96
- };
97
- async function resumeDeployment(connection, jobId, wait) {
98
- try {
99
- const deploy = new MetadataApiDeploy({ usernameOrConnection: connection, id: jobId });
100
- const result = await deploy.pollStatus({ timeout: Duration.minutes(wait) });
101
- return textResponse(`Deploy result: ${JSON.stringify(result.response)}`, !result.response.success);
102
- }
103
- catch (error) {
104
- return textResponse(`Resumed deployment failed: ${error instanceof Error ? error.message : 'Unknown error'}`, true);
105
- }
106
- }
107
- async function resumeOrgSnapshot(connection, jobId, wait) {
108
- try {
109
- const poller = await PollingClient.create({
110
- timeout: Duration.minutes(wait),
111
- frequency: Duration.seconds(30),
112
- poll: async () => {
113
- const queryResult = await connection.singleRecordQuery(`SELECT Status, Id, SnapshotName, Description, ExpirationDate, CreatedDate FROM OrgSnapshot WHERE Id = '${jobId}'`);
114
- if (queryResult.Status !== 'In Progress') {
115
- // either done or error
116
- return { completed: true, payload: queryResult };
117
- }
118
- else {
119
- return { completed: false };
120
- }
121
- },
122
- });
123
- const result = await poller.subscribe();
124
- return textResponse(`Org snapshot: ${JSON.stringify(result)}`);
125
- }
126
- catch (error) {
127
- return textResponse(`Resumed org snapshot failed: ${error instanceof Error ? error.message : 'Unknown error'}`, true);
128
- }
129
- }
130
- async function resumeScratchOrg(jobId, wait) {
131
- try {
132
- const result = await scratchOrgResume(jobId, Duration.minutes(wait));
133
- return textResponse(`Scratch org created: ${JSON.stringify(result)}`, false);
134
- }
135
- catch (error) {
136
- return textResponse(`Resumed scratch org creation failed: ${error instanceof Error ? error.message : 'Unknown error'}`, true);
137
- }
138
- }
139
- async function resumeAgentTest(connection, jobId, wait) {
140
- try {
141
- const agentTester = new AgentTester(connection);
142
- const result = await agentTester.poll(jobId, { timeout: Duration.minutes(wait) });
143
- return textResponse(`Agent test result: ${JSON.stringify(result)}`, !!result.errorMessage);
144
- }
145
- catch (error) {
146
- return textResponse(`Resumed agent test failed: ${error instanceof Error ? error.message : 'Unknown error'}`, true);
147
- }
148
- }
149
- //# sourceMappingURL=sf-resume.js.map
@@ -1,5 +0,0 @@
1
- import { SfMcpServer } from '../../sf-mcp-server.js';
2
- /**
3
- * Suggest a Salesforce CLI (sf) command based on user input.
4
- */
5
- export declare const registerToolSuggestCliCommand: (server: SfMcpServer) => void;
@@ -1 +0,0 @@
1
- export * from './sf-query-org.js';
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './sf-query-org.js';
17
- //# sourceMappingURL=index.js.map
@@ -1,20 +0,0 @@
1
- import { z } from 'zod';
2
- import { SfMcpServer } from '../../sf-mcp-server.js';
3
- export declare const queryOrgParamsSchema: z.ZodObject<{
4
- query: z.ZodString;
5
- usernameOrAlias: z.ZodString;
6
- directory: z.ZodEffects<z.ZodString, string, string>;
7
- useToolingApi: z.ZodOptional<z.ZodBoolean>;
8
- }, "strip", z.ZodTypeAny, {
9
- query: string;
10
- directory: string;
11
- usernameOrAlias: string;
12
- useToolingApi?: boolean | undefined;
13
- }, {
14
- query: string;
15
- directory: string;
16
- usernameOrAlias: string;
17
- useToolingApi?: boolean | undefined;
18
- }>;
19
- export type QueryOrgOptions = z.infer<typeof queryOrgParamsSchema>;
20
- export declare const registerToolQueryOrg: (server: SfMcpServer) => void;
@@ -1,66 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /*
17
- * Query Salesforce org
18
- *
19
- * Run a SOQL query against a Salesforce org.
20
- *
21
- * Parameters:
22
- * - query: SOQL query to run (required)
23
- * - usernameOrAlias: username or alias for the Salesforce org to run the query against
24
- *
25
- * Returns:
26
- * - textResponse: SOQL query results
27
- */
28
- import { z } from 'zod';
29
- import { getConnection } from '../../shared/auth.js';
30
- import { textResponse } from '../../shared/utils.js';
31
- import { directoryParam, usernameOrAliasParam, useToolingApiParam } from '../../shared/params.js';
32
- export const queryOrgParamsSchema = z.object({
33
- query: z.string().describe('SOQL query to run'),
34
- usernameOrAlias: usernameOrAliasParam,
35
- directory: directoryParam,
36
- useToolingApi: useToolingApiParam,
37
- });
38
- export const registerToolQueryOrg = (server) => {
39
- server.tool('sf-query-org', 'Run a SOQL query against a Salesforce org.', queryOrgParamsSchema.shape, {
40
- title: 'Query Org',
41
- openWorldHint: false,
42
- readOnlyHint: true,
43
- }, async ({ query, usernameOrAlias, directory, useToolingApi }) => {
44
- try {
45
- if (!usernameOrAlias)
46
- return textResponse('The usernameOrAlias parameter is required, if the user did not specify one use the #sf-get-username tool', true);
47
- process.chdir(directory);
48
- const connection = await getConnection(usernameOrAlias);
49
- const result = useToolingApi ? await connection.tooling.query(query) : await connection.query(query);
50
- return textResponse(`SOQL query results:\n\n${JSON.stringify(result, null, 2)}`);
51
- }
52
- catch (error) {
53
- let errorMessage = error instanceof Error ? error.message : 'Unknown error';
54
- if (errorMessage.endsWith('is not supported.')) {
55
- if (useToolingApi) {
56
- errorMessage += '\nTry not using the Tooling API for this query.';
57
- }
58
- else {
59
- errorMessage += '\nTry using the Tooling API for this query.';
60
- }
61
- }
62
- return textResponse(`Failed to query org: ${errorMessage}`, true);
63
- }
64
- });
65
- };
66
- //# sourceMappingURL=sf-query-org.js.map
@@ -1,2 +0,0 @@
1
- export { registerToolEnableTools } from './sf-enable-tools.js';
2
- export { registerToolListTools } from './sf-list-tools.js';
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export { registerToolEnableTools } from './sf-enable-tools.js';
17
- export { registerToolListTools } from './sf-list-tools.js';
18
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- import { SfMcpServer } from '../../sf-mcp-server.js';
2
- export declare function registerToolEnableTools(server: SfMcpServer): void;
@@ -1,42 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { z } from 'zod';
17
- import { textResponse } from '../../shared/utils.js';
18
- import { enableTools } from '../../shared/tools.js';
19
- const enableToolsParamsSchema = z.object({
20
- tools: z.array(z.string()).describe('The names of the tools to enable'),
21
- });
22
- export function registerToolEnableTools(server) {
23
- server.tool('sf-enable-tools', `Enable one or more of the tools the Salesforce MCP server provides.
24
-
25
- AGENT INSTRUCTIONS:
26
- Use sf-list-all-tools first to learn what tools are available for enabling.
27
- Once you have enabled the tool, you MUST invoke that tool to accomplish the user's original request - DO NOT USE A DIFFERENT TOOL OR THE COMMAND LINE.`, enableToolsParamsSchema.shape, {
28
- title: 'Enable Salesforce MCP tools',
29
- readOnlyHint: true,
30
- openWorldHint: false,
31
- }, async ({ tools }) => {
32
- if (tools.length === 0) {
33
- return textResponse('No tools specified to enable.', true);
34
- }
35
- const results = await enableTools(tools);
36
- server.sendToolListChanged();
37
- const hasError = results.some((result) => !result.success);
38
- const resultMessages = results.map((result) => result.message).join('\n');
39
- return textResponse(resultMessages, hasError);
40
- });
41
- }
42
- //# sourceMappingURL=sf-enable-tools.js.map
@@ -1,2 +0,0 @@
1
- import { SfMcpServer } from '../../sf-mcp-server.js';
2
- export declare function registerToolListTools(server: SfMcpServer): void;
@@ -1,2 +0,0 @@
1
- export * from './sf-deploy-metadata.js';
2
- export * from './sf-retrieve-metadata.js';
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright 2025, Salesforce, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './sf-deploy-metadata.js';
17
- export * from './sf-retrieve-metadata.js';
18
- //# sourceMappingURL=index.js.map
@@ -1,27 +0,0 @@
1
- import { z } from 'zod';
2
- import { SfMcpServer } from '../../sf-mcp-server.js';
3
- declare const deployMetadataParams: z.ZodObject<{
4
- sourceDir: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5
- manifest: z.ZodOptional<z.ZodString>;
6
- apexTestLevel: z.ZodOptional<z.ZodEnum<["NoTestRun", "RunLocalTests", "RunAllTestsInOrg"]>>;
7
- apexTests: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
- usernameOrAlias: z.ZodString;
9
- directory: z.ZodEffects<z.ZodString, string, string>;
10
- }, "strip", z.ZodTypeAny, {
11
- directory: string;
12
- usernameOrAlias: string;
13
- sourceDir?: string[] | undefined;
14
- manifest?: string | undefined;
15
- apexTestLevel?: "NoTestRun" | "RunLocalTests" | "RunAllTestsInOrg" | undefined;
16
- apexTests?: string[] | undefined;
17
- }, {
18
- directory: string;
19
- usernameOrAlias: string;
20
- sourceDir?: string[] | undefined;
21
- manifest?: string | undefined;
22
- apexTestLevel?: "NoTestRun" | "RunLocalTests" | "RunAllTestsInOrg" | undefined;
23
- apexTests?: string[] | undefined;
24
- }>;
25
- export type DeployMetadata = z.infer<typeof deployMetadataParams>;
26
- export declare const registerToolDeployMetadata: (server: SfMcpServer) => void;
27
- export {};