Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

get_sfra_categories

Retrieve SFRA document categories with counts and descriptions to understand documentation organization and discover available functionality for Salesforce Commerce Cloud development.

Instructions

Get all available SFRA document categories with counts and descriptions. Use this to understand the organization of SFRA documentation and discover what types of functionality are available. Helpful for exploring the full scope of SFRA capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler configuration for the 'get_sfra_categories' tool, including the exec function that delegates to SFRAClient.getAvailableCategories() to retrieve available SFRA documentation categories.
    get_sfra_categories: {
      defaults: (args: ToolArguments) => args,
      validate: (_args: ToolArguments, _toolName: string) => {
        // No validation needed for list operation
      },
      exec: async (_args: ToolArguments, context: ToolExecutionContext) => {
        const client = context.sfraClient as SFRAClient;
        return client.getAvailableCategories();
      },
      logMessage: (_args: ToolArguments) => 'SFRA categories',
    },
  • The supporting utility method in SFRAClient that implements the logic to compute and return SFRA document categories by scanning available documents, counting per category, and providing descriptions.
    async getAvailableCategories(): Promise<Array<{category: string; count: number; description: string}>> {
      const documents = await this.getAvailableDocuments();
      const categoryMap = new Map<string, number>();
    
      documents.forEach(doc => {
        categoryMap.set(doc.category, (categoryMap.get(doc.category) ?? 0) + 1);
      });
    
      const categoryDescriptions = {
        'core': 'Core SFRA classes and modules (Server, Request, Response, QueryString, render)',
        'product': 'Product-related models and functionality',
        'order': 'Order, cart, billing, shipping, and payment models',
        'customer': 'Customer account and address models',
        'pricing': 'Pricing and discount models',
        'store': 'Store and location models',
        'other': 'Other models and utilities',
      };
    
      return Array.from(categoryMap.entries()).map(([category, count]) => ({
        category,
        count,
        description: categoryDescriptions[category as keyof typeof categoryDescriptions] || 'Other documentation',
      }));
    }
  • The tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: 'get_sfra_categories',
      description: 'Get all available SFRA document categories with counts and descriptions. Use this to understand the organization of SFRA documentation and discover what types of functionality are available. Helpful for exploring the full scope of SFRA capabilities.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Registration of the SFRAToolHandler in the MCP server, which handles the 'get_sfra_categories' tool along with 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'),
    ];
  • The SFRAToolHandler class that manages SFRA tools, including initialization of SFRAClient, tool dispatch via config, and providing execution context with the client.
    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,
        };
      }
    }
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 implies a read-only operation by using 'Get' and describes the output format ('categories with counts and descriptions'), but lacks details on behavioral traits like rate limits, authentication needs, or whether the data is cached. The description adds some context about exploring SFRA capabilities but does not fully compensate for the absence of 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 appropriately sized and front-loaded, with the first sentence stating the core purpose and the following sentences providing useful context without redundancy. Every sentence earns its place by clarifying usage and benefits, making it efficient and well-structured.

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

Completeness4/5

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

Given the tool's complexity (simple read operation with no parameters) and the absence of annotations and output schema, the description is reasonably complete. It explains what the tool returns ('categories with counts and descriptions') and its utility for exploration. However, it could be more complete by specifying the output format or any limitations, though the lack of an output schema reduces the burden.

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

Parameters4/5

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

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description does not need to add parameter semantics, so it appropriately focuses on the tool's purpose and usage. A baseline of 4 is applied as it effectively handles the lack of parameters without unnecessary detail.

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 all available SFRA document categories') and resources ('categories with counts and descriptions'). It distinguishes from siblings like 'get_sfra_documents_by_category' by focusing on metadata about categories rather than documents within them, and from 'get_available_sfra_documents' by targeting categories specifically.

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 for when to use this tool ('to understand the organization of SFRA documentation and discover what types of functionality are available'), which helps differentiate it from siblings that retrieve documents or search content. However, it does not explicitly state when not to use it or name specific alternatives, such as using 'get_sfra_documents_by_category' for documents within a category.

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