Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

search_sfcc_classes

Search Salesforce B2C Commerce Cloud classes by name or functionality to find relevant APIs and explore available features for development tasks.

Instructions

Search for SFCC classes by name or functionality. Use this when you know part of a class name or need to find classes related to specific functionality (e.g., search 'catalog' to find catalog-related classes). Perfect starting point when you're unsure of the exact class name or exploring available APIs for a feature area.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for class names. Only use one word at a time (e.g., "catalog", "order", "customer"). Combining multiple words or attempting to look for multiple classes at the same time is not supported.

Implementation Reference

  • MCP tool definition including name, description, and input schema for search_sfcc_classes
    {
      name: 'search_sfcc_classes',
      description: "Search for SFCC classes by name or functionality. Use this when you know part of a class name or need to find classes related to specific functionality (e.g., search 'catalog' to find catalog-related classes). Perfect starting point when you're unsure of the exact class name or exploring available APIs for a feature area.",
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for class names. Only use one word at a time (e.g., "catalog", "order", "customer"). Combining multiple words or attempting to look for multiple classes at the same time is not supported.',
          },
        },
        required: ['query'],
      },
    },
  • Tool handler specification defining validation, defaults, execution (delegates to client.searchClasses), and logging for search_sfcc_classes
    search_sfcc_classes: {
      defaults: (args: ToolArguments) => args,
      validate: (args: ToolArguments, toolName: string) => {
        ValidationHelpers.validateArguments(args, CommonValidations.requiredString('query'), toolName);
      },
      exec: async (args: ToolArguments, context: ToolExecutionContext) => {
        const client = context.docsClient as SFCCDocumentationClient;
        return client.searchClasses(args.query as string);
      },
      logMessage: (args: ToolArguments) => `Search classes ${args.query}`,
    },
  • DocsToolHandler class that handles execution dispatch for all documentation tools including search_sfcc_classes using DOCS_TOOL_CONFIG
    export class DocsToolHandler extends BaseToolHandler<DocToolName> {
      private docsClient: SFCCDocumentationClient | null = null;
    
      constructor(context: HandlerContext, subLoggerName: string) {
        super(context, subLoggerName);
      }
    
      protected async onInitialize(): Promise<void> {
        if (!this.docsClient) {
          this.docsClient = new SFCCDocumentationClient();
          this.logger.debug('Documentation client initialized');
        }
      }
    
      protected async onDispose(): Promise<void> {
        this.docsClient = null;
        this.logger.debug('Documentation client disposed');
      }
    
      canHandle(toolName: string): boolean {
        return DOC_TOOL_NAMES_SET.has(toolName as DocToolName);
      }
    
      protected getToolNameSet(): Set<DocToolName> {
        return DOC_TOOL_NAMES_SET;
      }
    
      protected getToolConfig(): Record<string, GenericToolSpec<ToolArguments, any>> {
        return DOCS_TOOL_CONFIG;
      }
    
      protected async createExecutionContext(): Promise<ToolExecutionContext> {
        if (!this.docsClient) {
          throw new Error('Documentation client not initialized');
        }
    
        return {
          handlerContext: this.context,
          logger: this.logger,
          docsClient: this.docsClient,
        };
      }
    }
  • Core implementation of searchClasses: initializes docs, checks cache, filters and sorts class names matching query (case-insensitive substring), formats names, caches result
    async searchClasses(query: string): Promise<string[]> {
      await this.initialize();
    
      // Check cache first
      const cacheKey = `search:classes:${query.toLowerCase()}`;
      const cachedResult = this.cacheManager.getSearchResults(cacheKey);
      if (cachedResult) {
        return cachedResult;
      }
    
      const lowercaseQuery = query.toLowerCase();
      const results = Array.from(this.classCache.keys())
        .filter(className => className.toLowerCase().includes(lowercaseQuery))
        .sort()
        .map(className => ClassNameResolver.toOfficialFormat(className));
    
      // Cache the results
      this.cacheManager.setSearchResults(cacheKey, results);
      return results;
    }
  • Server instantiation of all tool handlers, including DocsToolHandler for documentation tools like search_sfcc_classes (line 101)
    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'),
    ];
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 describes the search functionality and use cases but lacks details on behavioral traits like pagination, rate limits, authentication requirements, or error handling. The description doesn't contradict any annotations (since none exist), but it's incomplete for a search tool with no annotation coverage.

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 front-loaded with the core purpose in the first sentence, followed by specific usage guidelines. Every sentence adds value: the first defines the tool, the second explains when to use it, and the third reinforces its role as a starting point. No wasted words or redundancy.

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 moderate complexity (search functionality with one parameter), no annotations, and no output schema, the description is adequate but has gaps. It covers purpose and usage well but lacks behavioral details (e.g., result format, limitations) and output information. It's complete enough for basic use but not for full operational understanding.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the single 'query' parameter with clear constraints. The description adds some context by mentioning examples like 'catalog', 'order', 'customer' and relating it to functionality exploration, but doesn't provide additional syntax or format details beyond what the schema specifies. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Search for SFCC classes') and resources ('by name or functionality'), distinguishing it from siblings like 'list_sfcc_classes' (which likely lists all classes without filtering) and 'get_sfcc_class_documentation' (which retrieves detailed docs for a known class). It explicitly mentions searching by partial names or functionality areas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'when you know part of a class name or need to find classes related to specific functionality' and 'Perfect starting point when you're unsure of the exact class name or exploring available APIs for a feature area.' It distinguishes this from tools for listing all classes or getting detailed documentation for known classes.

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