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;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It adequately describes the tool's behavior as a read-only information retrieval tool ('Get detailed information'), but lacks details about rate limits, authentication requirements, error conditions, or response format. The mention of 'SFCC Rhino environment' provides some context, but behavioral specifics are minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences that each serve distinct purposes: stating the tool's function, providing usage guidelines, and specifying target use cases. It's front-loaded with the core purpose and avoids redundancy. Minor improvement could be made by slightly tightening the cartridge development examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 8 parameters, 100% schema coverage, but no annotations and no output schema, the description provides adequate context about when and why to use the tool. However, it lacks information about the response format, error handling, or performance characteristics that would be helpful given the tool's complexity and lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description doesn't add any parameter-specific information beyond what's already documented in the schema. It mentions the general purpose ('detailed information about an SFCC class') but provides no additional context about parameter usage, interactions, or best practices.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get detailed information') and resources ('SFCC class'), and explicitly distinguishes it from siblings by focusing on class details rather than listing (list_sfcc_classes), searching (search_sfcc_classes), or documentation (get_sfcc_class_documentation). It identifies the exact information returned: properties, methods, and description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('when you need to understand what a specific SFCC class does, what methods/properties are available, or when implementing features that use SFCC APIs') and includes specific use cases ('Essential for cartridge development...'). It implicitly distinguishes from siblings by focusing on detailed class analysis rather than broader searches or listings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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