Skip to main content
Glama

SFCC Development MCP Server

by taurgis
docs-handler.ts1.63 kB
import { BaseToolHandler, ToolExecutionContext, GenericToolSpec, ToolArguments, HandlerContext } from './base-handler.js'; import { SFCCDocumentationClient } from '../../clients/docs-client.js'; import { DOCS_TOOL_CONFIG, DocToolName, DOC_TOOL_NAMES_SET } from '../../tool-configs/docs-tool-config.js'; /** * Handler for SFCC documentation tools using config-driven dispatch * Provides access to SFCC class information, search, and documentation */ export class DocsToolHandler extends BaseToolHandler<DocToolName> { private docsClient: SFCCDocumentationClient | null = null; constructor(context: HandlerContext, subLoggerName: string) { super(context, subLoggerName); } protected async onInitialize(): Promise<void> { if (!this.docsClient) { this.docsClient = new SFCCDocumentationClient(); this.logger.debug('Documentation client initialized'); } } protected async onDispose(): Promise<void> { this.docsClient = null; this.logger.debug('Documentation client disposed'); } canHandle(toolName: string): boolean { return DOC_TOOL_NAMES_SET.has(toolName as DocToolName); } protected getToolNameSet(): Set<DocToolName> { return DOC_TOOL_NAMES_SET; } protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { return DOCS_TOOL_CONFIG; } protected async createExecutionContext(): Promise<ToolExecutionContext> { if (!this.docsClient) { throw new Error('Documentation client not initialized'); } return { handlerContext: this.context, logger: this.logger, docsClient: this.docsClient, }; } }

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