Skip to content

Commit 2f6487f

Browse files
committed
Merge branch 'main' into ew/pft
2 parents 133d9a8 + fb0a14b commit 2f6487f

File tree

8 files changed

+90
-75
lines changed

8 files changed

+90
-75
lines changed

.github/workflows/publish-mcp-server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
cd packages/mcp
4444
4545
# Define all provider packages
46-
ALL_PROVIDERS=("@salesforce/mcp-provider-api" "@salesforce/mcp-provider-dx-core" "@salesforce/mcp-provider-mobile-web" "@salesforce/mcp-provider-code-analyzer" "@salesforce/mcp-provider-scale-products" "@salesforce/mcp-provider-metadata-enrichment")
46+
ALL_PROVIDERS=("@salesforce/mcp-provider-api" "@salesforce/mcp-provider-dx-core" "@salesforce/mcp-provider-mobile-web" "@salesforce/mcp-provider-code-analyzer" "@salesforce/mcp-provider-scale-products" "@salesforce/mcp-provider-devops" "@salesforce/mcp-provider-metadata-enrichment")
4747
4848
# Determine which providers to update
4949
if [ -n "${{ inputs.providers-to-update }}" ]; then

.github/workflows/publish-providers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- "packages/mcp-provider-mobile-web/**"
1111
- "packages/mcp-provider-code-analyzer/**"
1212
- "packages/mcp-provider-scale-products/**"
13+
- "packages/mcp-provider-devops/**"
1314
- "packages/mcp-provider-metadata-enrichment/**"
1415
workflow_dispatch:
1516
inputs:
@@ -37,7 +38,7 @@ jobs:
3738
id: detect
3839
run: |
3940
# Packages that auto-publish on push to main
40-
AUTO_PUBLISHABLE_PACKAGES=("mcp-provider-api" "mcp-provider-dx-core" "mcp-provider-code-analyzer" "mcp-provider-mobile-web" "mcp-provider-scale-products" "mcp-provider-metadata-enrichment")
41+
AUTO_PUBLISHABLE_PACKAGES=("mcp-provider-api" "mcp-provider-dx-core" "mcp-provider-code-analyzer" "mcp-provider-mobile-web" "mcp-provider-scale-products" "mcp-provider-devops" "mcp-provider-metadata-enrichment")
4142
4243
# All available provider packages
4344
ALL_PACKAGES=("mcp-provider-api" "mcp-provider-dx-core" "mcp-provider-code-analyzer" "mcp-provider-mobile-web" "mcp-provider-scale-products" "mcp-provider-devops" "mcp-provider-metadata-enrichment")

packages/mcp-provider-scale-products/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.0.5](https://github.com/salesforcecli/mcp/compare/mcp-provider-scale-products@0.0.4...mcp-provider-scale-products@0.0.5) (2026-02-25)
2+
3+
4+
15
## [0.0.4](https://github.com/salesforcecli/mcp/compare/mcp-provider-scale-products@0.0.3...mcp-provider-scale-products@0.0.4) (2026-02-18)
26

37

packages/mcp-provider-scale-products/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,22 @@ To unlock **runtime-aware severity** powered by ApexGuru, the tool needs access
7878

7979
| Level | Meaning |
8080
|---|---|
81-
| **Minor** | Low-impact issue; fix when convenient |
82-
| **Major** | Moderate performance risk; should be addressed |
83-
| **Critical** | High-impact hotspot; fix with priority |
81+
| **Minor** | Deviates from quality standards; fix when convenient |
82+
| **Major** | Reduces usability or causes a crucial part of your software to fail |
83+
| **Critical** | Highest priority; issues with run time, count, and other factors that result in software failure |
8484

8585
When runtime metrics are available (org connected + ApexGuru enabled), severity is calculated from actual production execution data rather than static heuristics.
8686

87+
## Best Practices
88+
89+
If your MCP client isn't calling the Scale tools you expect, try these tips:
90+
91+
1. **Scope tool execution.** Use the `--toolsets scale-products` argument in your MCP config files to improve tool resolution. Too many registered tools make it difficult for your MCP host to resolve the correct one. Disable any tools you don't actively use.
92+
93+
2. **Reference tools explicitly.** Reference the tool by name in your prompt so the LLM knows exactly which tool to invoke. For example:
94+
95+
> *Scan MyClass.cls for performance antipatterns using the `scan_apex_class_for_antipatterns` MCP tool.*
96+
8797
## Development
8898

8999
Ensure you are in the monorepo root or the package directory.

packages/mcp-provider-scale-products/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/mcp-provider-scale-products",
33
"description": "(For Internal Use Only) MCP Provider for Salesforce Scale Products - Apex antipattern detection and recommendations",
4-
"version": "0.0.4",
4+
"version": "0.0.5",
55
"author": "Salesforce",
66
"license": "Apache-2.0",
77
"type": "module",

packages/mcp-provider-scale-products/src/tools/scan-apex-antipatterns-tool.ts

Lines changed: 59 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -118,30 +118,16 @@ export class ScanApexAntipatternsTool extends McpTool<InputArgsShape, OutputArgs
118118
public getConfig(): McpToolConfig<InputArgsShape, OutputArgsShape> {
119119
return {
120120
title: "Scan Apex Class for Antipatterns",
121-
description:
122-
"Apex Code Scan Tool: Invoke (alongside other code scan tools if needed) whenever the user intends to scan or analyze an Apex class. " +
123-
"Analyzes an Apex class file for performance antipatterns and provides " +
124-
"recommendations for fixing them. Currently detects: " +
125-
"1) Schema.getGlobalDescribe() usage with optimized alternatives " +
126-
"2) SOQL queries without WHERE or LIMIT clauses " +
127-
"3) SOQL queries with unused fields (with fix generation). " +
128-
"Distinguishes between different severity levels (e.g., usage in loops vs. ordinary usage). " +
129-
"When authenticated to an org with ApexGuru enabled, severity is calculated from actual runtime metrics. " +
130-
"IMPORTANT: If the user does not mention an org alias or username in the request, call #get_username tool to resolve the default org username. " +
131-
"Requires an absolute path to the Apex class file. " +
132-
"\n" +
133-
"==== PRESENTATION INSTRUCTIONS ====" +
134-
"\n1. ALWAYS start with a clear header indicating whether runtime analysis from production org was used:" +
135-
" - If runtime metrics were used: '🔬 LEVERAGING YOUR ORG'S RUNTIME INTELLIGENCE VIA APEXGURU: Analyzing with Production Metrics from [OrgId]'" +
136-
"\n2. Display this LEGEND prominently at the beginning of your response:" +
137-
" ╔════════════════════════════════════════════════════════╗\n" +
138-
" ║ SEVERITY LEGEND ║\n" +
139-
" ╠════════════════════════════════════════════════════════╣\n" +
140-
" ║ 🟡 = Minor Severity Antipattern ║\n" +
141-
" ║ 🟠 = Major Severity Antipattern ║\n" +
142-
" ║ 🔴 = Critical Severity Antipattern ║\n" +
143-
" ║ 💡 = Severity from Production Metrics ║\n" +
144-
" ╚════════════════════════════════════════════════════════╝\n",
121+
description: `Apex Code Scan Tool: Invoke (alongside other code scan tools if needed) whenever the user intends to scan or analyze an Apex class.
122+
Analyzes an Apex class file for performance antipatterns and provides recommendations for fixing them. Currently detects:
123+
1) Schema.getGlobalDescribe() usage with optimized alternatives
124+
2) SOQL queries without WHERE or LIMIT clauses
125+
3) SOQL queries with unused fields (with fix generation).
126+
Distinguishes between different severity levels (e.g., usage in loops vs. ordinary usage).
127+
When authenticated to an org with ApexGuru enabled, severity is calculated from actual runtime metrics.
128+
IMPORTANT: If the user does not mention an org alias or username in the request, call #get_username tool to resolve the default org username.
129+
Requires an absolute path to the Apex class file.
130+
`,
145131
inputSchema: scanApexInputSchema.shape,
146132
outputSchema: undefined,
147133
annotations: {
@@ -449,51 +435,57 @@ export class ScanApexAntipatternsTool extends McpTool<InputArgsShape, OutputArgs
449435
0
450436
);
451437

452-
let response = "";
453-
454-
// Add header based on runtime analysis status
455-
if (runtimeDataStatus === RuntimeDataStatus.SUCCESS) {
456-
response += `# 🔬 Leveraging Your Org's Runtime Intelligence via ApexGuru\n\n`;
457-
}
458-
// Add severity legend
459-
response += `╔════════════════════════════════════════════════════════╗\n`;
460-
response += `║ SEVERITY LEGEND ║\n`;
461-
response += `╠════════════════════════════════════════════════════════╣\n`;
462-
response += `║ 🟡 = Minor Severity Antipattern ║\n`;
463-
response += `║ 🟠 = Major Severity Antipattern ║\n`;
464-
response += `║ 🔴 = Critical Severity Antipattern ║\n`;
465-
response += `║ 💡 = Severity from Production Metrics ║\n`;
466-
response += `╚════════════════════════════════════════════════════════╝\n\n`;
467-
468-
response += `## Antipattern Scan Results for '${className}'\n\n`;
469-
response += `Found ${totalIssues} issue(s) across ${scanResult.antipatternResults.length} antipattern type(s).\n`;
470-
471-
response += this.getRuntimeDataMessage(runtimeDataStatus);
472-
response += `\n`;
473-
474-
response += `## Scan Results\n\n`;
475-
response += "Results are grouped by antipattern type. Each type has:\n";
476-
response += "- **fixInstruction**: How to fix this antipattern type (applies to all instances)\n";
477-
response += "- **detectedInstances**: All detected instances of this type\n\n";
478-
479-
// Transform results to add bulb icon for runtime-derived severity
438+
const runtimeHeader = runtimeDataStatus === RuntimeDataStatus.SUCCESS
439+
? `# 🔬 Maximizing Organizational Runtime Intelligence with ApexGuru\n\n`
440+
: "";
441+
480442
const displayResult = this.addSeverityIcons(scanResult);
481443

482-
response += "```json\n";
483-
response += JSON.stringify(displayResult, null, 2);
484-
response += "\n```\n\n";
485-
486-
response += `## Instructions for Code Fixes\n\n`;
487-
response += `When applying fixes in code, include the following in comments:\n`;
488-
response += `- For each antipattern, include the appropriate severity dot (🟡/🟠/🔴)\n`;
489-
response += `- Add 💡 next to severity dot when runtime metrics were used to calculate severity\n\n`;
490-
response += `The scan result contains multiple antipattern types. For each type:\n`;
491-
response += `1. Read the \`fixInstruction\` - this explains how to fix this antipattern\n`;
492-
response += `2. For each instance in \`detectedInstances\`:\n`;
493-
response += ` - Examine \`codeBefore\` (the problematic code)\n`;
494-
response += ` - Consider \`severity\` (critical/major/minor)\n`;
495-
response += ` - Generate the fixed code following the instruction\n\n`;
496-
response += `Generate fixes for all detected instances across all antipattern types.\n`;
444+
const response = `==== PRESENTATION INSTRUCTIONS ====
445+
1. ALWAYS start with a clear header indicating whether runtime analysis from production org was used:
446+
- If runtime metrics were used: '🔬 Analyzing with Production Metrics from [OrgId]'
447+
- Otherwise: do not use the runtime header.
448+
2. Display the SEVERITY LEGEND prominently at the beginning of your response.
449+
450+
${runtimeHeader}
451+
**SEVERITY LEGEND**
452+
- 🟡 Minor: Deviates from quality standards
453+
- 🟠 Major: Reduces usability or causes failure
454+
- 🔴 Critical: Highest priority, causes failure
455+
- 💡 Severity from Production Metrics
456+
457+
**Presentation:** Be concise, conversational, direct, and positive. Address the reader as "you." Use a casual tone but avoid jargon and slang. Avoid "please" and "sorry"; use exclamation points sparingly. Design text for easy scanning.
458+
459+
## Antipattern Scan Results for '${className}'
460+
461+
Found ${totalIssues} issue(s) across ${scanResult.antipatternResults.length} antipattern type(s).
462+
${this.getRuntimeDataMessage(runtimeDataStatus)}
463+
464+
## Scan Results
465+
466+
Results are grouped by antipattern type. Each type has:
467+
- **fixInstruction**: How to fix this antipattern type (applies to all instances)
468+
- **detectedInstances**: All detected instances of this type
469+
470+
\`\`\`json
471+
${JSON.stringify(displayResult, null, 2)}
472+
\`\`\`
473+
474+
## Instructions for Code Fixes
475+
476+
When applying fixes in code, include the following in comments:
477+
- For each antipattern, include the appropriate severity dot (🟡/🟠/🔴)
478+
- Add 💡 next to severity dot when runtime metrics were used to calculate severity
479+
480+
The scan result contains multiple antipattern types. For each type:
481+
1. Read the \`fixInstruction\` - this explains how to fix this antipattern
482+
2. For each instance in \`detectedInstances\`:
483+
- Examine \`codeBefore\` (the problematic code)
484+
- Consider \`severity\` (critical/major/minor)
485+
- Generate the fixed code following the instruction
486+
487+
Generate fixes for all detected instances across all antipattern types.
488+
`;
497489

498490
return response;
499491
}

packages/mcp/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [0.26.9](https://github.com/salesforcecli/mcp/compare/0.26.8...0.26.9) (2026-02-25)
2+
3+
4+
5+
## [0.26.8](https://github.com/salesforcecli/mcp/compare/0.26.7...0.26.8) (2026-02-25)
6+
7+
8+
19
## [0.26.7](https://github.com/salesforcecli/mcp/compare/0.26.6...0.26.7) (2026-02-19)
210

311

packages/mcp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@salesforce/mcp",
3-
"version": "0.26.7",
3+
"version": "0.26.9",
44
"description": "MCP Server for interacting with Salesforce instances",
55
"bin": {
66
"sf-mcp-server": "bin/run.js"
@@ -51,7 +51,7 @@
5151
"@salesforce/mcp-provider-aura-experts": "0.3.6",
5252
"@salesforce/mcp-provider-mobile-web": "0.2.2",
5353
"@salesforce/mcp-provider-devops": "0.2.0",
54-
"@salesforce/mcp-provider-scale-products": "0.0.4",
54+
"@salesforce/mcp-provider-scale-products": "0.0.5",
5555
"@salesforce/mcp-provider-metadata-enrichment": "0.0.4",
5656
"@salesforce/source-deploy-retrieve": "^12.31.7",
5757
"@salesforce/source-tracking": "^7.8.2",

0 commit comments

Comments
 (0)