Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

get_sfcc_class_info

Retrieve detailed SFCC class information including properties, methods, and descriptions to understand API functionality and support cartridge development in the dw.* namespace.

Instructions

Get detailed information about an SFCC class including properties, methods, and description. Use this when you need to understand what a specific SFCC class does, what methods/properties are available, or when implementing features that use SFCC APIs. Essential for cartridge development (controllers, scripts, templates, rest-apis) using the dw.* namespace in the SFCC Rhino environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameYesThe SFCC class name (e.g., 'Catalog', 'dw.catalog.Catalog')
expandNoWhether to include detailed information about referenced types used by this class (default: false)
includeDescriptionNoWhether to include the class description in the response (default: true)
includeConstantsNoWhether to include constants in the response (default: true)
includePropertiesNoWhether to include properties in the response (default: true)
includeMethodsNoWhether to include methods in the response (default: true)
includeInheritanceNoWhether to include inheritance hierarchy in the response (default: true)
searchNoOptional search term to filter constants, properties, methods, and inheritance entries. Case-insensitive search across names and descriptions. Only one word at a time (e.g., "get", "create", "order"). Combining multiple words or looking for multiple items at the same time is not supported.

Implementation Reference

  • Handler configuration defining defaults, validation, execution logic (calls SFCCDocumentationClient.getClassDetailsExpanded), and logging message for the get_sfcc_class_info tool.
    get_sfcc_class_info: { defaults: (args: ToolArguments) => ({ ...args, expand: args.expand ?? false, includeDescription: args.includeDescription ?? true, includeConstants: args.includeConstants ?? true, includeProperties: args.includeProperties ?? true, includeMethods: args.includeMethods ?? true, includeInheritance: args.includeInheritance ?? true, search: args.search ?? undefined, }), validate: (args: ToolArguments, toolName: string) => { ValidationHelpers.validateArguments(args, CommonValidations.requiredString('className'), toolName); }, exec: async (args: ToolArguments, context: ToolExecutionContext) => { const client = context.docsClient as SFCCDocumentationClient; const result = await client.getClassDetailsExpanded( args.className as string, args.expand as boolean, { includeDescription: args.includeDescription as boolean, includeConstants: args.includeConstants as boolean, includeProperties: args.includeProperties as boolean, includeMethods: args.includeMethods as boolean, includeInheritance: args.includeInheritance as boolean, search: args.search as string | undefined, }, ); if (!result) { throw new Error(`Class "${args.className}" not found`); } return result; }, logMessage: (args: ToolArguments) => `Class info ${args.className} expand=${args.expand ?? false} ${args.search ? `search="${args.search}"` : ''}`, },
  • MCP tool definition object for get_sfcc_class_info, including full inputSchema with parameters, descriptions, defaults, and tool description.
    { name: 'get_sfcc_class_info', description: 'Get detailed information about an SFCC class including properties, methods, and description. Use this when you need to understand what a specific SFCC class does, what methods/properties are available, or when implementing features that use SFCC APIs. Essential for cartridge development (controllers, scripts, templates, rest-apis) using the dw.* namespace in the SFCC Rhino environment.', inputSchema: { type: 'object', properties: { className: { type: 'string', description: "The SFCC class name (e.g., 'Catalog', 'dw.catalog.Catalog')", }, expand: { type: 'boolean', description: 'Whether to include detailed information about referenced types used by this class (default: false)', default: false, }, includeDescription: { type: 'boolean', description: 'Whether to include the class description in the response (default: true)', default: true, }, includeConstants: { type: 'boolean', description: 'Whether to include constants in the response (default: true)', default: true, }, includeProperties: { type: 'boolean', description: 'Whether to include properties in the response (default: true)', default: true, }, includeMethods: { type: 'boolean', description: 'Whether to include methods in the response (default: true)', default: true, }, includeInheritance: { type: 'boolean', description: 'Whether to include inheritance hierarchy in the response (default: true)', default: true, }, search: { type: 'string', description: 'Optional search term to filter constants, properties, methods, and inheritance entries. Case-insensitive search across names and descriptions. Only one word at a time (e.g., "get", "create", "order"). Combining multiple words or looking for multiple items at the same time is not supported.', }, }, required: ['className'], }, },
  • MCP server ListToolsRequestHandler registration where SFCC_DOCUMENTATION_TOOLS (including get_sfcc_class_info) is added to the available tools list.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { const tools = []; // Always available tools tools.push(...SFCC_DOCUMENTATION_TOOLS); tools.push(...BEST_PRACTICES_TOOLS); tools.push(...SFRA_DOCUMENTATION_TOOLS); tools.push(...CARTRIDGE_GENERATION_TOOLS); // Conditional tools based on available capabilities if (this.capabilities.canAccessLogs) { tools.push(...LOG_TOOLS); tools.push(...JOB_LOG_TOOLS); } if (this.capabilities.canAccessOCAPI) { tools.push(...SYSTEM_OBJECT_TOOLS); tools.push(...CODE_VERSION_TOOLS); } return { tools }; });
  • Registration of tool handlers in the MCP server, including new DocsToolHandler which handles get_sfcc_class_info.
    this.handlers = [ 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'), ];
  • Core helper method getClassDetailsExpanded in SFCCDocumentationClient that implements the detailed class info retrieval, filtering, searching, caching, and optional expansion of referenced types. Called directly by the tool handler.
    async getClassDetailsExpanded( className: string, expand: boolean = false, filterOptions?: ClassDetailsFilterOptions, ): Promise<SFCCClassDetails & { referencedTypes?: SFCCClassDetails[] } | null> { // Set default filter options const filters = { includeDescription: filterOptions?.includeDescription ?? true, includeConstants: filterOptions?.includeConstants ?? true, includeProperties: filterOptions?.includeProperties ?? true, includeMethods: filterOptions?.includeMethods ?? true, includeInheritance: filterOptions?.includeInheritance ?? true, search: filterOptions?.search, }; // Check cache first for expanded details with filter options const cacheKey = `details-expanded:${className}:${expand}:${JSON.stringify(filters)}`; const cachedResult = this.cacheManager.getClassDetails(cacheKey); if (cachedResult !== undefined) { return cachedResult; } const classDetails = await this.getClassDetails(className); if (!classDetails) { this.cacheManager.setClassDetails(cacheKey, null); return null; } // Apply filtering and search to the class details const filteredDetails = this.applyFiltersAndSearch(classDetails, filters); if (!expand) { this.cacheManager.setClassDetails(cacheKey, filteredDetails); return filteredDetails; } // Get the raw content to extract referenced types const content = await this.getClassDocumentation(className); if (!content) { this.cacheManager.setClassDetails(cacheKey, filteredDetails); return filteredDetails; } const referencedTypeNames = ReferencedTypesExtractor.extractFilteredReferencedTypes(content, className); const referencedTypes: SFCCClassDetails[] = []; // Get details for each referenced type for (const typeName of referencedTypeNames) { try { const typeDetails = await this.getClassDetails(typeName); if (typeDetails) { referencedTypes.push(typeDetails); } } catch { // Silently skip types that can't be found this.logger.warn(`Could not find details for referenced type: ${typeName}`); } } const result = { ...filteredDetails, referencedTypes: referencedTypes.length > 0 ? referencedTypes : undefined, }; // Cache the result this.cacheManager.setClassDetails(cacheKey, result); return result; }

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