Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/mcp-tool-renames.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@salesforce/b2c-dx-mcp': minor
'@salesforce/b2c-dx-docs': patch
---

Rename MCP tools for clearer, action-oriented naming. scapi_custom_api_scaffold → scapi_custom_api_generate_scaffold. sfnext_map_tokens_to_theme → sfnext_match_tokens_to_theme.
18 changes: 9 additions & 9 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ const referenceSidebar = [
items: [
{text: 'cartridge_deploy', link: '/mcp/tools/cartridge-deploy'},
{text: 'mrt_bundle_push', link: '/mcp/tools/mrt-bundle-push'},
{text: 'pwakit_development_guidelines', link: '/mcp/tools/pwakit-development-guidelines'},
{text: 'pwakit_get_guidelines', link: '/mcp/tools/pwakit-get-guidelines'},
{text: 'scapi_schemas_list', link: '/mcp/tools/scapi-schemas-list'},
{text: 'scapi_custom_api_scaffold', link: '/mcp/tools/scapi-custom-api-scaffold'},
{text: 'scapi_custom_apis_status', link: '/mcp/tools/scapi-custom-apis-status'},
{text: 'storefront_next_development_guidelines', link: '/mcp/tools/storefront-next-development-guidelines'},
{text: 'storefront_next_figma_to_component_workflow', link: '/mcp/tools/storefront-next-figma-to-component-workflow'},
{text: 'storefront_next_generate_component', link: '/mcp/tools/storefront-next-generate-component'},
{text: 'storefront_next_map_tokens_to_theme', link: '/mcp/tools/storefront-next-map-tokens-to-theme'},
{text: 'storefront_next_page_designer_decorator', link: '/mcp/tools/storefront-next-page-designer-decorator'},
{text: 'storefront_next_site_theming', link: '/mcp/tools/storefront-next-site-theming'},
{text: 'scapi_custom_api_generate_scaffold', link: '/mcp/tools/scapi-custom-api-generate-scaffold'},
{text: 'scapi_custom_apis_get_status', link: '/mcp/tools/scapi-custom-apis-get-status'},
{text: 'sfnext_get_guidelines', link: '/mcp/tools/sfnext-get-guidelines'},
{text: 'sfnext_start_figma_workflow', link: '/mcp/tools/sfnext-start-figma-workflow'},
{text: 'sfnext_analyze_component', link: '/mcp/tools/sfnext-analyze-component'},
{text: 'sfnext_match_tokens_to_theme', link: '/mcp/tools/sfnext-match-tokens-to-theme'},
{text: 'sfnext_add_page_designer_decorator', link: '/mcp/tools/sfnext-add-page-designer-decorator'},
{text: 'sfnext_configure_theme', link: '/mcp/tools/sfnext-configure-theme'},
],
},
];
Expand Down
10 changes: 5 additions & 5 deletions docs/mcp/figma-tools-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Prerequisites and setup for Figma-to-component tools (workflow orch

# Figma-to-Component Tools Setup

Prerequisites and setup for using the Figma workflow tools: `storefront_next_figma_to_component_workflow`, `storefront_next_generate_component`, and `storefront_next_map_tokens_to_theme`.
Prerequisites and setup for using the Figma workflow tools: `sfnext_start_figma_workflow`, `sfnext_analyze_component`, and `sfnext_match_tokens_to_theme`.

> **Note:** 🚧 This MCP tool is for Storefront Next. Storefront Next is part of a closed pilot and isn't available for general use.

Expand All @@ -15,7 +15,7 @@ The Figma-to-component workflow requires an **external Figma MCP server** to fet
**Prerequisites:**
- b2c-dx-mcp configured with `--allow-non-ga-tools` flag (Figma tools are preview)
- Storefront Next project
- `app.css` theme file (required for `storefront_next_map_tokens_to_theme` tool; optional path can be provided)
- `app.css` theme file (required for `sfnext_match_tokens_to_theme` tool; optional path can be provided)
- External Figma MCP server enabled in your MCP client

See [Installation](./installation) for b2c-dx-mcp setup.
Expand Down Expand Up @@ -49,8 +49,8 @@ If the Figma MCP server is not enabled, the workflow tool will still return inst

## Related Documentation

- [storefront_next_figma_to_component_workflow](./tools/storefront-next-figma-to-component-workflow) - Workflow orchestrator (call first)
- [storefront_next_generate_component](./tools/storefront-next-generate-component) - REUSE/EXTEND/CREATE recommendation
- [storefront_next_map_tokens_to_theme](./tools/storefront-next-map-tokens-to-theme) - Token mapping
- [sfnext_start_figma_workflow](./tools/sfnext-start-figma-workflow) - Workflow orchestrator (call first)
- [sfnext_analyze_component](./tools/sfnext-analyze-component) - REUSE/EXTEND/CREATE recommendation
- [sfnext_match_tokens_to_theme](./tools/sfnext-match-tokens-to-theme) - Token mapping
- [STOREFRONTNEXT Toolset](./toolsets#storefrontnext) - Overview of Storefront Next tools
- [Figma MCP Server Documentation](https://developers.figma.com/docs/figma-mcp-server) - Official Figma MCP setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
description: Get PWA Kit v3 development guidelines and best practices for React, Chakra UI, and Commerce API.
---

# pwakit_development_guidelines
# pwakit_get_guidelines

Returns critical architecture rules, coding standards, and best practices for building PWA Kit v3 applications with React, Chakra UI, and Commerce API.

## Overview

The `pwakit_development_guidelines` tool provides essential development guidance for PWA Kit v3. It:
The `pwakit_get_guidelines` tool provides essential development guidance for PWA Kit v3. It:

1. Returns comprehensive guidelines by default (quick-reference plus key sections).
2. Supports retrieving specific topic sections on demand.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
description: Generate a new custom SCAPI endpoint (OAS 3.0 schema, api.json, script.js) in an existing cartridge.
---

# scapi_custom_api_scaffold
# scapi_custom_api_generate_scaffold

Generate a new custom SCAPI endpoint in an existing cartridge. Creates `schema.yaml` (OAS 3.0 contract), `api.json` (endpoint mapping), and `script.js` (implementation) under the cartridge's `rest-apis/<apiName>/` directory.

## Overview

The `scapi_custom_api_scaffold` tool scaffolds a new custom API using the B2C tooling SDK's `custom-api` scaffold. It:
The `scapi_custom_api_generate_scaffold` tool scaffolds a new custom API using the B2C tooling SDK's `custom-api` scaffold. It:

- Creates an OpenAPI 3.0 schema, API manifest, and script stub in your project.
- Uses the first cartridge found in the project if you don't specify one.
- Supports **shopper** (siteId, customer-facing) or **admin** (no siteId) API types.

**No instance or OAuth required** — this tool works locally and only writes files into your project. To check registration status after deployment, use [`scapi_custom_apis_status`](./scapi-custom-apis-status).
**No instance or OAuth required** — this tool works locally and only writes files into your project. To check registration status after deployment, use [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status).

## Parameters

Expand Down Expand Up @@ -78,15 +78,15 @@ Returns the scaffold ID, output directory, and list of created files:
1. **Edit** `schema.yaml` to define paths, request/response schemas, and operation IDs.
2. **Edit** `script.js` to implement the endpoint logic.
3. **Deploy** the cartridge to your instance and **activate** the code version to register the API.
4. **Verify** with [`scapi_custom_apis_status`](./scapi-custom-apis-status) that endpoints show as `active`.
4. **Verify** with [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status) that endpoints show as `active`.

Shopper APIs are available at:
`https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/v1/organizations/{organizationId}/...` and require the `siteId` query parameter and ShopperToken authentication.

## Related Tools

- Part of the [SCAPI](../toolsets#scapi), [PWAV3](../toolsets#pwav3), and [STOREFRONTNEXT](../toolsets#storefrontnext) toolsets
- [`scapi_custom_apis_status`](./scapi-custom-apis-status) — Check custom API endpoint registration status after deployment
- [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status) — Check custom API endpoint registration status after deployment
- [`scapi_schemas_list`](./scapi-schemas-list) — List or fetch custom API schemas (use `apiFamily: "custom"`)

## See Also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
description: Check the registration status of custom SCAPI endpoints deployed on your B2C Commerce instance.
---

# scapi_custom_apis_status
# scapi_custom_apis_get_status

List custom SCAPI endpoint registration status (active/not_registered). Returns one row per endpoint per site with detailed status information.

## Overview

Checks the registration status of custom API endpoints deployed on your B2C Commerce instance. Returns endpoint status (`active` or `not_registered`) with per-site details.

**Note:** This tool queries your live instance. For schema definitions, use [`scapi_schemas_list`](./scapi-schemas-list) with `apiFamily: "custom"`. To create a new custom API, use [`scapi_custom_api_scaffold`](./scapi-custom-api-scaffold).
**Note:** This tool queries your live instance. For schema definitions, use [`scapi_schemas_list`](./scapi-schemas-list) with `apiFamily: "custom"`. To create a new custom API, use [`scapi_custom_api_generate_scaffold`](./scapi-custom-api-generate-scaffold).

## Authentication

Expand Down
23 changes: 8 additions & 15 deletions docs/mcp/tools/scapi-schemas-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `scapi_schemas_list` tool provides two modes of operation.
1. **List (Discovery)**: Browse available schemas without fetching full OpenAPI specs.
2. **Fetch**: Retrieve complete OpenAPI schema for a specific API.

This tool works with both standard SCAPI (Shop, Admin, Shopper APIs) and custom APIs. For endpoint registration status, use [`scapi_custom_apis_status`](./scapi-custom-apis-status) instead.
This tool works with both standard SCAPI (Shop, Admin, Shopper APIs) and custom APIs. For endpoint registration status, use [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status) instead.

## Authentication

Expand Down Expand Up @@ -48,12 +48,6 @@ Omit `includeSchemas` or any identifier to browse available schemas:
- `availableApiNames` - List of available API names
- `availableApiVersions` - List of available API versions

**Example prompts:**
- ✅ "Use the MCP tool to list all available SCAPI schemas."
- ✅ "Use the MCP tool to show me what checkout APIs exist." → `apiFamily: "checkout"`
- ✅ "Use the MCP tool to discover SCAPI product endpoints." → `apiFamily: "product"`
- ✅ "Use the MCP tool to list custom API definitions." → `apiFamily: "custom"`

Comment on lines -51 to -56
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I didn't see example prompt clean-up in the PR description so I'm not sure if these changes are intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated section. Its available in ## Usage Examples section so I remove it.

### Fetch Mode

Set `includeSchemas: true` and provide all three identifiers (`apiFamily`, `apiName`, `apiVersion`) to fetch a complete OpenAPI schema:
Expand All @@ -62,11 +56,6 @@ Set `includeSchemas: true` and provide all three identifiers (`apiFamily`, `apiN
- Full OpenAPI schema specification
- Use `expandAll: true` to get the complete schema without collapsing

**Example prompts:**
- ✅ "Use the MCP tool to get the OpenAPI schema for shopper-baskets v1." → `apiFamily: "shopper"`, `apiName: "shopper-baskets"`, `apiVersion: "v1"`, `includeSchemas: true`
- ✅ "Use the MCP tool to show me the full OpenAPI spec for shopper-products v1." → `includeSchemas: true`, `expandAll: true`
- ✅ "Use the MCP tool to show me the loyalty-points custom API schema." → `apiFamily: "custom"`, `apiName: "loyalty-points"`, `apiVersion: "v1"`, `includeSchemas: true`

## Usage Examples

### Standard SCAPI Discovery
Expand All @@ -83,6 +72,10 @@ Filter by API family:
Use the MCP tool to show me what checkout APIs exist.
```

```
Use the MCP tool to discover SCAPI product endpoints.
```

### Custom API Discovery

List custom API definitions:
Expand Down Expand Up @@ -154,13 +147,13 @@ Use the MCP tool to show me the full OpenAPI spec for shopper-products v1.

- Part of the [SCAPI](../toolsets#scapi), [PWAV3](../toolsets#pwav3), and [STOREFRONTNEXT](../toolsets#storefrontnext) toolsets
- Always enabled (base toolset)
- For endpoint registration status, use [`scapi_custom_apis_status`](./scapi-custom-apis-status)
- For endpoint registration status, use [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status)

## See Also

- [SCAPI Toolset](../toolsets#scapi) - Overview of SCAPI discovery tools
- [scapi_custom_apis_status](./scapi-custom-apis-status) - Check custom API endpoint registration status
- [scapi_custom_api_scaffold](./scapi-custom-api-scaffold) - Generate a new custom API in a cartridge
- [scapi_custom_apis_get_status](./scapi-custom-apis-get-status) - Check custom API endpoint registration status
- [scapi_custom_api_generate_scaffold](./scapi-custom-api-generate-scaffold) - Generate a new custom API in a cartridge
- [Authentication Setup](../../guide/authentication#scapi-authentication) - Set up SCAPI authentication with required roles and scopes
- [Configuration](../configuration) - Configure OAuth credentials
- [CLI Reference](../../cli/scapi-schemas) - Equivalent CLI commands: `b2c scapi schemas list` and `b2c scapi schemas get`
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
description: Add Page Designer decorators to React components for Storefront Next to make them available in Page Designer.
---

# storefront_next_page_designer_decorator
# sfnext_add_page_designer_decorator

Adds Page Designer decorators (`@Component`, `@AttributeDefinition`, `@RegionDefinition`) to React components to make them available in Page Designer for Storefront Next.

> **Note:** 🚧 This MCP tool is for Storefront Next. Storefront Next is part of a closed pilot and isn't available for general use.

## Overview

The `storefront_next_page_designer_decorator` tool analyzes React components and generates Page Designer decorators that enable components to be used in Page Designer. It supports two modes:
The `sfnext_add_page_designer_decorator` tool analyzes React components and generates Page Designer decorators that enable components to be used in Page Designer. It supports two modes:

1. **Auto Mode**: Quick setup with sensible defaults-automatically selects suitable props, infers types, and generates decorators immediately.
2. **Interactive Mode**: Multi-step workflow for fine-tuned control over decorator configuration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
description: Analyze Figma design and discovered components to recommend REUSE, EXTEND, or CREATE strategy.
description: Analyze design and discovered components to recommend REUSE, EXTEND, or CREATE strategy.
---

# storefront_next_generate_component
# sfnext_analyze_component

Analyzes Figma design and discovered components to recommend a component generation strategy. Returns a REUSE, EXTEND, or CREATE action with confidence score, key differences, and suggested implementation approach.
Analyzes design and discovered components to recommend a component generation strategy. Returns a REUSE, EXTEND, or CREATE action with confidence score, key differences, and suggested implementation approach.

> **Note:** 🚧 This MCP tool is for Storefront Next. Storefront Next is part of a closed pilot and isn't available for general use.

## Overview

The `storefront_next_generate_component` tool compares Figma-generated React code against existing components discovered in the codebase. It analyzes differences across styling, structure, behavior, and props, then recommends the best approach:
The `sfnext_analyze_component` tool compares design React code (e.g., from Figma, design handoff, or other sources) against existing components discovered in the codebase. It analyzes differences across styling, structure, behavior, and props, then recommends the best approach:

- **REUSE**: Use existing component with props or minor styling adjustments
- **EXTEND**: Extend existing component via props, variant, or composition pattern
- **CREATE**: Create a new component (reference existing patterns if applicable)

**Workflow position:** Call this tool **after** retrieving Figma design data and discovering similar components. It is a required step in the Figma-to-component workflow.
**Workflow position:** Call this tool **after** retrieving design data and discovering similar components. It is a required step in the Figma-to-component workflow.

This tool is part of the STOREFRONTNEXT toolset.

## Prerequisites

- Figma design data retrieved via Figma MCP tools
- Design React code (from Figma MCP, design handoff, or other sources)
- Component discovery performed before calling
- Storefront Next project

Expand All @@ -32,9 +32,9 @@ See [Figma-to-Component Tools Setup](../figma-tools-setup) for complete prerequi

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `figmaMetadata` | string | Yes | JSON string containing Figma design metadata from `mcp__figma__get_metadata`. Can be empty string if metadata was not fetched. |
| `figmaCode` | string | Yes | Generated React code from Figma (from `mcp__figma__get_design_context`). |
| `componentName` | string | Yes | Suggested name for the component extracted from the Figma design. |
| `figmaMetadata` | string | Yes | JSON string containing design metadata (from Figma MCP or empty). Can be empty string if metadata was not fetched. |
| `figmaCode` | string | Yes | React code from design (e.g., from Figma `mcp__figma__get_design_context`, or design handoff). |
| `componentName` | string | Yes | Suggested name for the component extracted from the design. |
| `discoveredComponents` | array | Yes | Array of similar components discovered using Glob/Grep/Read. Pass empty array if no similar components found. |
| `workspacePath` | string | No | Optional workspace root path. Defaults to the MCP server project directory. |

Expand All @@ -50,6 +50,23 @@ Each item in `discoveredComponents` must have:
| `matchType` | string | One of `'name'`, `'structure'`, `'visual'` |
| `code` | string | Full source code of the component |

## Usage Examples

### With Figma design URL

```
I have a Figma design at [URL]. Use the MCP tool to fetch the design code, search the codebase for similar components, then analyze and recommend whether to reuse, extend, or create a component.
```

### With design code already fetched

```
Use the MCP tool to analyze this design and recommend reuse, extend, or create. Design code: [paste React/JSX from Figma or design handoff]. Search the codebase for similar components first, then call the tool with the discovered components.
```

### Agent workflow note

When the agent searches the codebase and finds no similar components, it should still call the tool with `discoveredComponents: []` to get a CREATE recommendation. The user does not need to specify this—the agent discovers it during the workflow.

## Output

Expand All @@ -62,25 +79,10 @@ Returns a formatted recommendation including:
- **Suggested Approach**: Implementation guidance
- **Next Steps**: Action-specific instructions

## Usage Examples

### With Discovered Components

```
Use the MCP tool to analyze the Figma design and recommend whether to reuse, extend, or create a component. I've discovered PrimaryButton and SecondaryButton as similar components.
```

### No Similar Components

```
Use the MCP tool to analyze the Figma design. No similar components were found in the codebase.
```


## Related Tools

- [`storefront_next_figma_to_component_workflow`](./storefront-next-figma-to-component-workflow) - Call first to get workflow instructions and Figma parameters
- [`storefront_next_map_tokens_to_theme`](./storefront-next-map-tokens-to-theme) - Map Figma design tokens to theme variables
- [`sfnext_start_figma_workflow`](./sfnext-start-figma-workflow) - Call first to get workflow instructions and Figma parameters
- [`sfnext_match_tokens_to_theme`](./sfnext-match-tokens-to-theme) - Match design tokens to theme variables
- Part of the [STOREFRONTNEXT](../toolsets#storefrontnext) toolset
- Auto-enabled for Storefront Next projects

Expand Down
Loading
Loading