Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

get_available_sfra_documents

Discover available SFRA documentation to understand Storefront Reference Architecture classes, modules, and models for development tasks.

Instructions

Get a list of all available SFRA (Storefront Reference Architecture) documentation. Use this to discover what SFRA classes, modules, and models are documented, including Server, Request, Response, QueryString, render module, and comprehensive model documentation for account, cart, products, pricing, billing, shipping, and more. Essential for understanding SFRA architecture and available functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler configuration defining the tool's validation, defaults, execution (calls SFRAClient.getAvailableDocuments()), and logging.
    get_available_sfra_documents: {
      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.getAvailableDocuments();
      },
      logMessage: (_args: ToolArguments) => 'List SFRA docs',
    },
  • Core implementation of getAvailableDocuments(): Scans SFRA docs directory for .md files (excluding README.md), extracts metadata for each using getSFRADocumentMetadata, categorizes, sorts (core first), caches, and returns list of document summaries.
    async getAvailableDocuments(): Promise<SFRADocumentSummary[]> {
      const cacheKey = 'sfra:available-documents-v2';
      const cached = this.cache.getSearchResults(cacheKey);
    
      // Check if we need to rescan the filesystem
      const now = Date.now();
      if (cached && (now - this.lastScanTime) < SFRAClient.SCAN_CACHE_TTL) {
        return cached;
      }
    
      try {
        const files = await fs.readdir(this.docsPath);
        const mdFiles = files.filter(file =>
          file.endsWith('.md') &&
          file !== 'README.md' &&
          !file.startsWith('.'),
        );
    
        const documents: SFRADocumentSummary[] = [];
    
        for (const filename of mdFiles) {
          try {
            const documentName = path.basename(filename, '.md');
            const document = await this.getSFRADocumentMetadata(documentName);
    
            if (document) {
              documents.push({
                name: documentName,
                title: document.title,
                description: document.description,
                type: document.type,
                category: document.category,
                filename: document.filename,
              });
            }
          } catch (error) {
            this.logger.error(`Error processing SFRA document ${filename}:`, error);
            // Continue processing other files
          }
        }
    
        // Sort documents by category and then by name
        documents.sort((a, b) => {
          if (a.category !== b.category) {
            // Prioritize core documents
            if (a.category === 'core') {return -1;}
            if (b.category === 'core') {return 1;}
            return a.category.localeCompare(b.category);
          }
          return a.name.localeCompare(b.name);
        });
    
        this.cache.setSearchResults(cacheKey, documents);
        this.lastScanTime = now;
    
        return documents;
      } catch (error) {
        this.logger.error('Error scanning SFRA documents directory:', error);
        return [];
      }
    }
  • MCP tool schema: name, detailed description, and inputSchema (empty object, no parameters).
    {
      name: 'get_available_sfra_documents',
      description: 'Get a list of all available SFRA (Storefront Reference Architecture) documentation. Use this to discover what SFRA classes, modules, and models are documented, including Server, Request, Response, QueryString, render module, and comprehensive model documentation for account, cart, products, pricing, billing, shipping, and more. Essential for understanding SFRA architecture and available functionality.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • MCP server listTools handler registration: Adds SFRA_DOCUMENTATION_TOOLS array (containing this tool's schema) to the available tools list.
    tools.push(...SFCC_DOCUMENTATION_TOOLS);
    tools.push(...BEST_PRACTICES_TOOLS);
    tools.push(...SFRA_DOCUMENTATION_TOOLS);
    tools.push(...CARTRIDGE_GENERATION_TOOLS);
  • SFRA tool handler class registration: Extends BaseToolHandler, provides SFRA_TOOL_CONFIG for dispatch, initializes SFRAClient, handles SFRA tool names including get_available_sfra_documents.
    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,
        };
      }
    }
Behavior2/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 of behavioral disclosure. It describes what the tool returns (a list of documentation) and its purpose (discovery, understanding architecture), but does not disclose behavioral traits like whether it's read-only, if it requires authentication, rate limits, pagination, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the core action and purpose. The second sentence elaborates with specific examples, and the third emphasizes importance. While efficient, the final sentence ('Essential for understanding...') could be considered slightly redundant with the first, but overall it's well-structured with minimal waste.

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 the tool's complexity (simple list retrieval with 0 parameters) and lack of annotations/output schema, the description is adequate but incomplete. It explains what the tool does and why to use it, but without annotations or output schema, it should ideally disclose more about the return format (e.g., structure of the list, data types) or behavioral constraints to fully compensate for missing structured data.

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 input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description appropriately adds no parameter details, focusing instead on the tool's purpose and output. This meets the baseline of 4 for zero-parameter tools, as it avoids unnecessary repetition of schema information.

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 specific action ('Get a list') and resource ('all available SFRA documentation'), distinguishing it from siblings like 'get_sfra_document' (singular) or 'get_sfra_documents_by_category' (filtered). It explicitly lists examples of what's included (classes, modules, models), making the purpose highly specific and differentiated.

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 discover what SFRA classes, modules, and models are documented' and 'Essential for understanding SFRA architecture'), but does not explicitly state when not to use it or name alternatives among the many sibling tools. The implied usage is strong but lacks explicit exclusions.

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