Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

get_sfcc_class_documentation

Retrieve comprehensive SFCC class documentation including examples and detailed descriptions to support in-depth development understanding.

Instructions

Get the complete raw documentation for an SFCC class. Use this when you need comprehensive details about a class including examples, detailed descriptions, and full context. Best for in-depth understanding when the basic class info isn't sufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameYesThe SFCC class name

Implementation Reference

  • Core handler function in SFCCDocumentationClient that implements the tool logic: initializes, caches, resolves class name, and returns raw markdown documentation content.
    async getClassDocumentation(className: string): Promise<string | null> {
      await this.initialize();
    
      // Check cache first
      const normalizedClassName = ClassNameResolver.normalizeClassName(className);
      const cacheKey = `content:${normalizedClassName}`;
      const cachedContent = this.cacheManager.getFileContent(cacheKey);
      if (cachedContent !== undefined) {
        return cachedContent || null;
      }
    
      // Resolve class name with fallback logic
      const resolved = ClassNameResolver.resolveClassName(normalizedClassName, this.classCache);
      const content = resolved ? resolved.info.content : null;
    
      // Cache the result (including null results to avoid repeated lookups)
      this.cacheManager.setFileContent(cacheKey, content ?? '');
    
      return content;
    }
  • Tool schema definition including name, description, and inputSchema with required 'className' parameter.
    {
      name: 'get_sfcc_class_documentation',
      description: "Get the complete raw documentation for an SFCC class. Use this when you need comprehensive details about a class including examples, detailed descriptions, and full context. Best for in-depth understanding when the basic class info isn't sufficient.",
      inputSchema: {
        type: 'object',
        properties: {
          className: {
            type: 'string',
            description: 'The SFCC class name',
          },
        },
        required: ['className'],
      },
    },
  • MCP server registration where SFCC_DOCUMENTATION_TOOLS (including this tool's schema) is added to the list of available tools.
    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 };
    });
  • Tool configuration defining validation, defaults, execution (delegates to client), and logging for the handler.
    get_sfcc_class_documentation: {
      defaults: (args: ToolArguments) => args,
      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.getClassDocumentation(args.className as string);
        if (!result) {
          throw new Error(`Documentation for class "${args.className}" not found`);
        }
        return result;
      },
      logMessage: (args: ToolArguments) => `Raw doc ${args.className}`,
    },
  • Registration of the DocsToolHandler which handles execution for documentation tools including get_sfcc_class_documentation.
    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'),
    ];
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the output as 'complete raw documentation' with 'examples, detailed descriptions, and full context,' which gives some behavioral insight into what the tool returns. However, it lacks details on potential errors, rate limits, authentication needs, or response format, leaving gaps for a tool with no annotations.

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

Conciseness5/5

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

The description is concise and well-structured, consisting of two sentences that efficiently convey purpose and usage guidelines. Every sentence adds value without redundancy, making it easy to understand quickly.

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?

Given no annotations and no output schema, the description provides adequate context for a simple read operation with one parameter. It explains the tool's purpose and when to use it, but lacks details on output format, error handling, or behavioral traits, which could be important for completeness in this context.

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?

The input schema has 100% description coverage, with the parameter 'className' documented as 'The SFCC class name.' The description doesn't add any parameter-specific information beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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

Purpose4/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: 'Get the complete raw documentation for an SFCC class.' It specifies the verb ('Get') and resource ('documentation for an SFCC class'), but doesn't explicitly differentiate it from sibling tools like 'get_sfcc_class_info' or 'search_sfcc_classes' beyond mentioning 'complete raw documentation' versus 'basic class info.'

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool: 'when you need comprehensive details about a class including examples, detailed descriptions, and full context' and 'when the basic class info isn't sufficient.' It implies an alternative (e.g., 'basic class info' likely refers to sibling tools), but doesn't explicitly name specific alternatives or state when not to use it.

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