Skip to main content
Glama
taurgis

SFCC Development MCP Server

by taurgis

search_best_practices

Find specific development guidance by searching best practice guides for topics like validation, security, performance optimization, or error handling.

Instructions

Search across all best practice guides for specific terms, patterns, or concepts. Use this when you need guidance on specific topics like validation, security, performance optimization, error handling, or any development pattern. Perfect for finding relevant best practices without reading entire guides.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term or concept (e.g., 'validation', 'security', 'performance'). Use single words for best results as the API does not support complex queries.

Implementation Reference

  • The handler configuration for the 'search_best_practices' tool. Defines validation (requires 'query' string), defaults, execution (delegates to SFCCBestPracticesClient.searchBestPractices), and logging.
    search_best_practices: {
      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.bestPracticesClient as SFCCBestPracticesClient;
        return client.searchBestPractices(args.query as string);
      },
      logMessage: (args: ToolArguments) => `Search best practices ${args.query}`,
    },
  • The core implementation of the search logic in SFCCBestPracticesClient.searchBestPractices. Loads all guides, searches line-by-line for query matches with section context, caches results, and returns structured matches.
    async searchBestPractices(query: string): Promise<Array<{
      guide: string;
      title: string;
      matches: Array<{section: string; content: string}>;
    }>> {
      const cacheKey = `best-practices:search:${query.toLowerCase()}`;
      const cached = this.cache.getSearchResults(cacheKey);
      if (cached) {return cached;}
    
      const guides = await this.getAvailableGuides();
      const results = [];
    
      for (const guide of guides) {
        const guideContent = await this.getBestPracticeGuide(guide.name);
        if (!guideContent) {continue;}
    
        const matches = [];
        const lines = guideContent.content.split('\n');
        let currentSection = '';
    
        for (let i = 0; i < lines.length; i++) {
          const line = lines[i];
    
          if (line.startsWith('##')) {
            currentSection = line.replace('##', '').trim();
          }
    
          if (line.toLowerCase().includes(query.toLowerCase())) {
            // Get context around the match
            const start = Math.max(0, i - 2);
            const end = Math.min(lines.length, i + 3);
            const context = lines.slice(start, end).join('\n');
    
            matches.push({
              section: currentSection || 'Introduction',
              content: context,
            });
          }
        }
    
        if (matches.length > 0) {
          results.push({
            guide: guide.name,
            title: guide.title,
            matches,
          });
        }
      }
    
      this.cache.setSearchResults(cacheKey, results);
      return results;
    }
  • The tool schema definition in BEST_PRACTICES_TOOLS array, specifying name, description, and inputSchema with required 'query' string parameter.
    {
      name: 'search_best_practices',
      description: 'Search across all best practice guides for specific terms, patterns, or concepts. Use this when you need guidance on specific topics like validation, security, performance optimization, error handling, or any development pattern. Perfect for finding relevant best practices without reading entire guides.',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: "Search term or concept (e.g., 'validation', 'security', 'performance'). Use single words for best results as the API does not support complex queries.",
          },
        },
        required: ['query'],
      },
    },
  • Registration of BEST_PRACTICES_TOOLS (including search_best_practices schema) into the MCP server's listTools response.
    tools.push(...BEST_PRACTICES_TOOLS);
  • Instantiation and registration of BestPracticesToolHandler which handles execution for best practices tools including search_best_practices.
    new BestPracticesToolHandler(context, 'BestPractices'),
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 discloses the tool's behavioral trait of searching across all guides and hints at efficiency ('without reading entire guides'), but it does not mention other important aspects like response format, pagination, rate limits, or error handling. The description does not contradict any annotations, as there are none.

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 adding 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.

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 function with one parameter) and no annotations or output schema, the description is adequate but has gaps. It covers the purpose and usage well but lacks details on behavioral traits like response format or error handling. For a search tool with no structured output information, more completeness would enhance agent 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?

The input schema has 100% description coverage, with the 'query' parameter well-documented in the schema. The description adds some context by listing example topics ('validation, security, performance optimization, error handling, or any development pattern'), which aligns with the schema's examples. However, it does not provide additional semantic details beyond what the schema already covers, such as query syntax or limitations not in the schema.

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 across all best practice guides') and resources ('best practice guides'), distinguishing it from siblings like 'get_best_practice_guide' (which retrieves a specific guide) or 'get_available_best_practice_guides' (which lists guides without searching). It explicitly mentions what it searches for ('terms, patterns, or concepts').

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 on when to use it ('when you need guidance on specific topics like validation, security, performance optimization, error handling, or any development pattern') and why ('Perfect for finding relevant best practices without reading entire guides'). However, it does not explicitly state when not to use it or name alternatives among siblings, such as using 'get_best_practice_guide' for a specific guide instead of searching.

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