Skip to main content
Glama
ember-tooling

Ember MCP Server

get_best_practices

Access Ember.js best practices and recommendations for specific development topics, including modern patterns, anti-patterns to avoid, performance tips, and community-approved approaches.

Instructions

Get Ember best practices and recommendations for specific topics. This includes modern patterns, anti-patterns to avoid, performance tips, and community-approved approaches. Always use this when providing implementation advice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesTopic to get best practices for (e.g., 'component patterns', 'state management', 'testing', 'performance')

Implementation Reference

  • Main tool handler that extracts the 'topic' argument, calls the documentation service to retrieve best practices, handles empty results, formats the output using formatBestPractices, and returns the MCP-formatted text content.
    async handleGetBestPractices(args) {
      const { topic } = args;
      const practices = await this.docService.getBestPractices(topic);
    
      if (practices.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: `No best practices found for "${topic}". Try searching with search_ember_docs for general information.`,
            },
          ],
        };
      }
    
      const formattedPractices = formatBestPractices(practices, topic, this.docService.deprecationManager);
      return {
        content: [
          {
            type: "text",
            text: formattedPractices,
          },
        ],
      };
    }
  • Core helper function in DocumentationService that implements the best practices search logic: matches topic terms (with singular/plural inflection), scores documents based on best practice keywords, extracts relevant content, examples, and anti-patterns, deduplicates, sorts by relevance, and returns formatted practice objects.
    async getBestPractices(topic) {
      const practices = [];
      const topicLower = topic.toLowerCase();
      const topicTerms = topicLower.split(/\s+/).filter(term => term.length > 2);
    
      // Search in community articles and guides
      const communityDocs = this.sections["community-bloggers"] || [];
      const allSections = [
        ...communityDocs,
        ...Object.entries(this.sections)
          .filter(([name]) => !["api-docs", "community-bloggers"].includes(name))
          .flatMap(([_, items]) => items),
      ];
    
      // Best practice keywords (weighted by relevance)
      const strongKeywords = BEST_PRACTICES_KEYWORDS.strong;
      const weakKeywords = BEST_PRACTICES_KEYWORDS.weak;
    
      // Track seen content to avoid duplicates
      const seenTitles = new Set();
    
      for (const doc of allSections) {
        const content = doc.content.toLowerCase();
    
        // Calculate relevance score
        let score = 0;
    
        // Topic term matching with inflection
        // Try exact match, singular form, and plural form
        const matchedTerms = topicTerms.filter(term => {
          if (content.includes(term)) return true;
    
          // Try singular form (e.g., "templates" -> "template", "classes" -> "class")
          const singular = this.toSingular(term);
          if (singular !== term && content.includes(singular)) return true;
    
          // Try plural form (e.g., "template" -> "templates")
          const plural = pluralize.plural(term);
          if (plural !== term && content.includes(plural)) return true;
    
          return false;
        });
    
        // Require at least one term to match
        if (matchedTerms.length === 0) {
          continue;
        }
    
        // Score based on topic term matches
        // Give more weight to each matched term to reward relevance
        score += matchedTerms.length * SEARCH_CONFIG.BP_TERM_MATCH_WEIGHT;
    
        // Bonus for all terms present
        if (matchedTerms.length === topicTerms.length) {
          score += SEARCH_CONFIG.BP_ALL_TERMS_BONUS;
        }
    
        // Strong keyword matches
        const strongMatches = strongKeywords.filter(keyword => content.includes(keyword));
        score += strongMatches.length * SEARCH_CONFIG.BP_STRONG_KEYWORD_WEIGHT;
    
        // Weak keyword matches (only if strong matches exist)
        if (strongMatches.length > 0) {
          const weakMatches = weakKeywords.filter(keyword => content.includes(keyword));
          score += weakMatches.length * SEARCH_CONFIG.BP_WEAK_KEYWORD_WEIGHT;
        }
    
        // Simpler threshold: just require at least one term match + some best-practice signal
        // The scoring already rewards multiple term matches and keyword presence
        const minThreshold = SEARCH_CONFIG.BP_MIN_THRESHOLD;
    
        // Skip if score is too low (not a best practice document)
        if (score < minThreshold) {
          continue;
        }
    
        const title = this.extractTitle(doc.content);
    
        // Skip duplicates
        if (seenTitles.has(title.toLowerCase())) {
          continue;
        }
        seenTitles.add(title.toLowerCase());
    
        const relevantSections = this.extractBestPracticeSections(
          doc.content,
          topicLower
        );
    
        if (relevantSections.content) {
          practices.push({
            title,
            content: relevantSections.content,
            examples: relevantSections.examples,
            antiPatterns: relevantSections.antiPatterns,
            references: [generateUrl("community-bloggers", title)],
            score: score, // Store for sorting
          });
        }
      }
    
      // Sort by relevance score (descending) and return top results
      practices.sort((a, b) => b.score - a.score);
      return practices.slice(0, SEARCH_CONFIG.MAX_BEST_PRACTICES).map(practice => {
        // Remove score before returning (internal only)
        const { score, ...practiceWithoutScore } = practice;
        return practiceWithoutScore;
      });
    }
  • JSON schema defining the input parameters for the get_best_practices tool: requires a 'topic' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        topic: {
          type: "string",
          description:
            "Topic to get best practices for (e.g., 'component patterns', 'state management', 'testing', 'performance')",
        },
      },
      required: ["topic"],
    },
  • index.js:185-186 (registration)
    Tool name registration in the CallToolRequestHandler switch statement dispatcher.
    case "get_best_practices":
      return await this.handleGetBestPractices(args);
  • index.js:100-115 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema for the MCP tools list.
    {
      name: "get_best_practices",
      description:
        "Get Ember best practices and recommendations for specific topics. This includes modern patterns, anti-patterns to avoid, performance tips, and community-approved approaches. Always use this when providing implementation advice.",
      inputSchema: {
        type: "object",
        properties: {
          topic: {
            type: "string",
            description:
              "Topic to get best practices for (e.g., 'component patterns', 'state management', 'testing', 'performance')",
          },
        },
        required: ["topic"],
      },
    },
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 mentions the tool returns 'modern patterns, anti-patterns to avoid, performance tips, and community-approved approaches,' which gives some behavioral context about the content type. However, it lacks details on response format, potential limitations, or error handling, leaving gaps in transparency.

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 two sentences, front-loaded with the core purpose and followed by usage guidance. Every sentence earns its place by adding distinct value, with no wasted words or redundancy.

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 moderate complexity (single parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and content scope well, but lacks details on output structure or potential errors, which would be helpful for an advisory tool.

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 'topic' parameter well-documented. The description adds minimal value beyond the schema by implying the topics include 'component patterns,' 'state management,' etc., but doesn't provide additional syntax or format details. This meets the baseline for high schema coverage.

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 best practices and recommendations') and resources ('Ember best practices for specific topics'), distinguishing it from sibling tools like get_api_reference or search_ember_docs by focusing on advisory content rather than reference or search functionality.

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 explicitly states when to use this tool: 'Always use this when providing implementation advice.' This provides clear guidance on its intended context, though it doesn't specify when not to use it or name alternatives, but the 'always' directive is strong enough for full credit.

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/ember-tooling/ember-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server