@salesforce/b2c-dx-mcp 1.9.0 → 1.9.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.
@@ -19,7 +19,8 @@ export function createDocsReadTool(loadServices, enabledCategories, detectedWork
19
19
  'fetched from its published URL on demand and cached locally (with a summary/headings fallback if ' +
20
20
  'the network is unavailable). If you do not know the id, call docs_search first. Long docs are ' +
21
21
  'truncated to maxLength chars; page with offset when truncated=true. The returned entry ' +
22
- 'includes the canonical url for citation.' +
22
+ 'includes the canonical url for citation and relatedEntries ids for directly connected Help or ' +
23
+ 'Developer Center articles.' +
23
24
  enabledCategoriesNote(enabledCategories),
24
25
  toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
25
26
  inputSchema: {
@@ -62,6 +62,12 @@ export function createDocsSearchTool(loadServices, detectedWorkspaces = [], enab
62
62
  .positive()
63
63
  .optional()
64
64
  .describe(`Maximum number of results to return. Defaults to ${DEFAULT_LIMIT}.`),
65
+ offset: z
66
+ .number()
67
+ .int()
68
+ .nonnegative()
69
+ .optional()
70
+ .describe('Number of ranked results to skip (for pagination). Defaults to 0.'),
65
71
  verbose: z
66
72
  .boolean()
67
73
  .optional()
@@ -69,17 +75,27 @@ export function createDocsSearchTool(loadServices, detectedWorkspaces = [], enab
69
75
  },
70
76
  async execute(args) {
71
77
  const workspace = resolveWorkspace(args.workspace, detectedWorkspaces);
72
- const results = searchDocs(args.query, {
73
- limit: args.limit ?? DEFAULT_LIMIT,
78
+ const limit = args.limit ?? DEFAULT_LIMIT;
79
+ const offset = args.offset ?? 0;
80
+ // The SDK returns top-N search hits. Retrieve the complete ranked set here
81
+ // so MCP can report a total and provide stable offset-based pagination.
82
+ const ranked = searchDocs(args.query, {
83
+ limit: Number.MAX_SAFE_INTEGER,
74
84
  category: args.category,
75
85
  workspace,
76
86
  enabledCategories,
77
87
  });
88
+ const results = ranked.slice(offset, offset + limit);
89
+ const end = offset + results.length;
90
+ const truncated = end < ranked.length;
78
91
  return {
79
92
  query: args.query,
80
93
  ...(args.category && { category: args.category }),
81
94
  ...(workspace && { workspace }),
95
+ total: ranked.length,
96
+ offset,
82
97
  results: results.map((r) => leanResult(r.entry, r.score, args.verbose ?? false)),
98
+ ...(truncated && { truncated: true, nextOffset: end }),
83
99
  };
84
100
  },
85
101
  formatOutput: (output) => jsonResult(output),
@@ -428,5 +428,5 @@
428
428
  "enableJsonFlag": false
429
429
  }
430
430
  },
431
- "version": "1.9.0"
431
+ "version": "1.9.1"
432
432
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/b2c-dx-mcp",
3
3
  "description": "MCP server for B2C Commerce developer experience tools",
4
- "version": "1.9.0",
4
+ "version": "1.9.1",
5
5
  "author": "Salesforce",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "SalesforceCommerceCloud/b2c-developer-tooling",
@@ -80,7 +80,7 @@
80
80
  "yaml": "2.9.0",
81
81
  "postcss": "8.5.15",
82
82
  "zod": "3.25.76",
83
- "@salesforce/b2c-tooling-sdk": "1.21.0"
83
+ "@salesforce/b2c-tooling-sdk": "1.21.1"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@eslint/compat": "^1",