get_sfra_documents_by_category
Retrieve SFRA documentation filtered by functional categories like core classes, product models, order/cart functionality, customer management, pricing, or store models to explore related documentation and understand functional groupings.
Instructions
Get SFRA documents filtered by category. Use this to explore documents in specific functional areas like core SFRA classes, product models, order/cart functionality, customer management, pricing, or store models. Perfect for discovering related documentation and understanding functional groupings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category to filter by: core (Server, Request, Response, etc.), product (product models), order (cart, billing, shipping), customer (account, address), pricing (price models), store (store models), other (utilities) |
Implementation Reference
- The tool handler configuration defining validation, defaults, execution logic (delegates to SFRAClient), and logging for get_sfra_documents_by_category.get_sfra_documents_by_category: { defaults: (args: ToolArguments) => args, validate: (args: ToolArguments, toolName: string) => { ValidationHelpers.validateArguments(args, CommonValidations.requiredString('category'), toolName); }, exec: async (args: ToolArguments, context: ToolExecutionContext) => { const client = context.sfraClient as SFRAClient; return client.getDocumentsByCategory(args.category as string); }, logMessage: (args: ToolArguments) => `SFRA docs by category ${args.category}`, },
- src/core/tool-definitions.ts:201-215 (schema)MCP tool schema definition with inputSchema specifying the required 'category' parameter and its enum values.{ name: 'get_sfra_documents_by_category', description: 'Get SFRA documents filtered by category. Use this to explore documents in specific functional areas like core SFRA classes, product models, order/cart functionality, customer management, pricing, or store models. Perfect for discovering related documentation and understanding functional groupings.', inputSchema: { type: 'object', properties: { category: { type: 'string', enum: ['core', 'product', 'order', 'customer', 'pricing', 'store', 'other'], description: 'Category to filter by: core (Server, Request, Response, etc.), product (product models), order (cart, billing, shipping), customer (account, address), pricing (price models), store (store models), other (utilities)', }, }, required: ['category'], }, },
- src/core/server.ts:98-107 (registration)Registration of all tool handlers including SFRAToolHandler (line 103) which handles get_sfra_documents_by_category and other SFRA tools.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'), ];
- src/clients/sfra-client.ts:379-382 (helper)Helper method in SFRAClient that implements the core filtering logic by category from available documents.async getDocumentsByCategory(category: string): Promise<SFRADocumentSummary[]> { const allDocuments = await this.getAvailableDocuments(); return allDocuments.filter(doc => doc.category === category); }
- SFRA tool handler class that manages SFRAClient and dispatches to tool configs based on tool name.export class SFRAToolHandler extends BaseToolHandler<SFRAToolName> { private sfraClient: SFRAClient | null = null; constructor(context: HandlerContext, subLoggerName: string) { super(context, subLoggerName); } protected async onInitialize(): Promise<void> { if (!this.sfraClient) { this.sfraClient = new SFRAClient(); this.logger.debug('SFRA client initialized'); } } protected async onDispose(): Promise<void> { this.sfraClient = null; this.logger.debug('SFRA client disposed'); } canHandle(toolName: string): boolean { return SFRA_TOOL_NAMES_SET.has(toolName as SFRAToolName); } protected getToolNameSet(): Set<SFRAToolName> { return SFRA_TOOL_NAMES_SET; } protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> { return SFRA_TOOL_CONFIG; } protected async createExecutionContext(): Promise<ToolExecutionContext> { if (!this.sfraClient) { throw new Error('SFRA client not initialized'); } return { handlerContext: this.context, logger: this.logger, sfraClient: this.sfraClient, }; } }