Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

search_sfcc_methods

Find methods across SFCC classes by method name to identify their associated classes or discover similar operations. Ideal for SFCC development when method details are unclear.

Instructions

Search for methods across all SFCC classes by method name. Use this when you know the method name but not which class it belongs to, or when looking for similar methods across different classes. Helpful for discovering all available methods that perform similar operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNameYesMethod name to search for. Only use one word at a time (e.g., "get", "create", "update"). Combining multiple words or looking for multiple methods at the same time is not supported.

Implementation Reference

  • Configuration for the search_sfcc_methods tool, including defaults, input validation requiring 'methodName', execution by calling SFCCDocumentationClient.searchMethods, and logging.
    search_sfcc_methods: { defaults: (args: ToolArguments) => args, validate: (args: ToolArguments, toolName: string) => { ValidationHelpers.validateArguments(args, CommonValidations.requiredString('methodName'), toolName); }, exec: async (args: ToolArguments, context: ToolExecutionContext) => { const client = context.docsClient as SFCCDocumentationClient; return client.searchMethods(args.methodName as string); }, logMessage: (args: ToolArguments) => `Search methods ${args.methodName}`, },
  • MCP tool definition including name, description, and input schema that requires a 'methodName' string parameter.
    { name: 'search_sfcc_methods', description: 'Search for methods across all SFCC classes by method name. Use this when you know the method name but not which class it belongs to, or when looking for similar methods across different classes. Helpful for discovering all available methods that perform similar operations.', inputSchema: { type: 'object', properties: { methodName: { type: 'string', description: 'Method name to search for. Only use one word at a time (e.g., "get", "create", "update"). Combining multiple words or looking for multiple methods at the same time is not supported.', }, }, required: ['methodName'], }, },
  • Registers the DocsToolHandler which handles the search_sfcc_methods tool among other documentation tools.
    new LogToolHandler(context, 'Log'), new JobLogToolHandler(context, 'JobLog'), new DocsToolHandler(context, 'Docs'), new BestPracticesToolHandler(context, 'BestPractices'), new SFRAToolHandler(context, 'SFRA'), new SystemObjectToolHandler(context, 'SystemObjects'), new CodeVersionToolHandler(context, 'CodeVersions'), new CartridgeToolHandler(context, 'Cartridge'), ];
  • DocsToolHandler class that initializes SFCCDocumentationClient, checks if it can handle the tool name via DOC_TOOL_NAMES_SET, provides DOCS_TOOL_CONFIG for dispatch, and creates execution context with the client instance.
    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, }; } }
  • Defines the list of documentation tool names including search_sfcc_methods, used by DocsToolHandler for canHandle checks.
    export const DOC_TOOL_NAMES = [ 'get_sfcc_class_info', 'search_sfcc_classes', 'search_sfcc_methods', 'list_sfcc_classes', 'get_sfcc_class_documentation', ] as const;

Latest Blog Posts

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