get_sfcc_class_documentation
Retrieve in-depth SFCC class documentation, including examples and detailed descriptions, to gain comprehensive insights when basic class information is insufficient. Ideal for SFCC developers seeking full context for enhanced 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
| Name | Required | Description | Default |
|---|---|---|---|
| className | Yes | The SFCC class name |
Implementation Reference
- Handler configuration for the get_sfcc_class_documentation tool, including validation and execution logic that fetches raw class documentation via SFCCDocumentationClientget_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}`, },
- src/core/tool-definitions.ts:93-106 (schema)Tool schema definition with input schema, description, and parameters for get_sfcc_class_documentation{ 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'], }, },
- src/core/server.ts:98-107 (registration)Registration of all tool handlers in the MCP server, including DocsToolHandler which handles get_sfcc_class_documentationthis.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'), ];
- src/core/server.ts:118-135 (registration)Registration of SFCC documentation tools (including get_sfcc_class_documentation schema) in the ListTools handlertools.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 }; });
- src/clients/docs-client.ts:106-125 (helper)Core helper method in SFCCDocumentationClient that retrieves raw Markdown documentation content for a given SFCC class, used by the tool handlerasync 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; }