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
| Name | Required | Description | Default |
|---|---|---|---|
| className | Yes | The SFCC class name |
Implementation Reference
- src/clients/docs-client.ts:106-125 (handler)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; }
- src/core/tool-definitions.ts:93-106 (schema)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'], }, },
- src/core/server.ts:114-135 (registration)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}`, },
- src/core/server.ts:98-107 (registration)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'), ];