Skip to main content
Glama

SFCC Development MCP Server

by taurgis
sfra-handler.ts1.58 kB
import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, HandlerContext, ToolArguments } from './base-handler.js'; import { SFRAClient } from '../../clients/sfra-client.js'; import { SFRA_TOOL_CONFIG, SFRAToolName, SFRA_TOOL_NAMES_SET, } from '../../tool-configs/sfra-tool-config.js'; /** * Handler for SFRA documentation tools using config-driven dispatch * Provides access to Storefront Reference Architecture documentation */ export class SFRAToolHandler extends BaseToolHandler<SFRAToolName> { private sfraClient: SFRAClient | null = null; constructor(context: HandlerContext, subLoggerName: string) { super(context, subLoggerName); } protected async onInitialize(): Promise<void> { if (!this.sfraClient) { this.sfraClient = new SFRAClient(); this.logger.debug('SFRA client initialized'); } } protected async onDispose(): Promise<void> { this.sfraClient = null; this.logger.debug('SFRA client disposed'); } canHandle(toolName: string): boolean { return SFRA_TOOL_NAMES_SET.has(toolName as SFRAToolName); } protected getToolNameSet(): Set<SFRAToolName> { return SFRA_TOOL_NAMES_SET; } protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { return SFRA_TOOL_CONFIG; } protected async createExecutionContext(): Promise<ToolExecutionContext> { if (!this.sfraClient) { throw new Error('SFRA client not initialized'); } return { handlerContext: this.context, logger: this.logger, sfraClient: this.sfraClient, }; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/taurgis/sfcc-dev-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server