Skip to main content
Glama

memory_enhanced_recommendation

Enhance project documentation recommendations by applying knowledge graph and memory learning to base suggestions, yielding context-aware results.

Instructions

Get enhanced recommendations using learning and knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project
baseRecommendationYesBase recommendation to enhance
projectFeaturesYes

Implementation Reference

  • Main handler function that processes a base recommendation by enriching it with similar projects, success patterns, confidence scoring, and alternative options from memory.
    export async function handleMemoryEnhancedRecommendation(args: {
      projectPath: string;
      baseRecommendation: any;
      projectFeatures: any;
    }): Promise<any> {
      await initializeMemory();
    
      // Get similar projects with same features
      const similarProjects = await getSimilarProjects(args.projectFeatures);
    
      // Analyze success patterns
      const successPatterns = await analyzeSuccessPatterns(similarProjects);
    
      // Enhanced recommendation with memory insights
      const enhancedRecommendation = {
        ...args.baseRecommendation,
        memoryEnhanced: {
          similarProjects,
          successPatterns,
          confidence: calculateConfidence(args.baseRecommendation, successPatterns),
          alternativeOptions: await getAlternativeOptions(
            args.baseRecommendation,
            successPatterns,
          ),
        },
      };
    
      return enhancedRecommendation;
    }
  • MCP tool registration with inputSchema defining required parameters: projectPath, baseRecommendation, and projectFeatures (with nested fields for language, framework, size, complexity, hasTests, hasCI, hasDocs, isOpenSource).
      name: "memory_enhanced_recommendation",
      description:
        "Get enhanced recommendations using learning and knowledge graph",
      inputSchema: {
        type: "object",
        properties: {
          projectPath: {
            type: "string",
            description: "Path to the project",
          },
          baseRecommendation: {
            type: "object",
            description: "Base recommendation to enhance",
          },
          projectFeatures: {
            type: "object",
            properties: {
              language: { type: "string" },
              framework: { type: "string" },
              size: { type: "string", enum: ["small", "medium", "large"] },
              complexity: {
                type: "string",
                enum: ["simple", "moderate", "complex"],
              },
              hasTests: { type: "boolean" },
              hasCI: { type: "boolean" },
              hasDocs: { type: "boolean" },
              isOpenSource: { type: "boolean" },
            },
            required: ["language"],
          },
        },
        required: ["projectPath", "baseRecommendation", "projectFeatures"],
      },
    },
  • Tool registration in the memoryTools array, defining the tool name, description, and input validation schema for MCP.
      name: "memory_enhanced_recommendation",
      description:
        "Get enhanced recommendations using learning and knowledge graph",
      inputSchema: {
        type: "object",
        properties: {
          projectPath: {
            type: "string",
            description: "Path to the project",
          },
          baseRecommendation: {
            type: "object",
            description: "Base recommendation to enhance",
          },
          projectFeatures: {
            type: "object",
            properties: {
              language: { type: "string" },
              framework: { type: "string" },
              size: { type: "string", enum: ["small", "medium", "large"] },
              complexity: {
                type: "string",
                enum: ["simple", "moderate", "complex"],
              },
              hasTests: { type: "boolean" },
              hasCI: { type: "boolean" },
              hasDocs: { type: "boolean" },
              isOpenSource: { type: "boolean" },
            },
            required: ["language"],
          },
        },
        required: ["projectPath", "baseRecommendation", "projectFeatures"],
      },
    },
  • Analyzes success patterns (SSG counts) from similar projects for use in confidence calculation and alternative options.
    async function analyzeSuccessPatterns(similarProjects: any[]): Promise<any> {
      const patterns = {
        ssgSuccess: {} as Record<string, number>,
        deploymentPatterns: [] as string[],
        commonFeatures: [] as string[],
      };
    
      // Analyze SSG success rates
      similarProjects.forEach((project: any) => {
        const ssg = project.recommendation;
        if (ssg) {
          patterns.ssgSuccess[ssg] = (patterns.ssgSuccess[ssg] || 0) + 1;
        }
      });
    
      return patterns;
    }
  • Calculates confidence score for the enhanced recommendation based on how often the recommended SSG succeeded in similar projects.
    function calculateConfidence(
      baseRecommendation: any,
      successPatterns: any,
    ): number {
      const recommended = baseRecommendation.recommended;
      const successCount = successPatterns.ssgSuccess[recommended] || 0;
      const totalProjects = Object.values(
        successPatterns.ssgSuccess as Record<string, number>,
      ).reduce((a: number, b: number) => a + b, 0);
    
      if (totalProjects === 0) return 0.5; // Default confidence
    
      return Math.min(successCount / totalProjects + 0.3, 1.0);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description should disclose behavioral traits. It mentions 'using learning' but does not clarify if this tool modifies state (e.g., learns from recommendations) or is read-only. The term 'get' suggests read-only, but 'learning' implies potential side effects.

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

Conciseness3/5

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

The description is a single concise sentence (9 words). However, conciseness comes at the cost of missing critical details. The structure is adequate but not informative.

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

Completeness1/5

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

Given three required parameters (including two empty objects), no output schema, and a complex domain (learning and knowledge graph), the description is severely incomplete. It does not explain the return value, prerequisites, or how the enhancement works, leaving the agent unable to use the tool effectively.

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

Parameters2/5

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

The input schema has 67% description coverage (projectPath and baseRecommendation described, projectFeatures missing). The description does not add any parameter semantics beyond the schema. It fails to clarify what 'projectFeatures' should contain or how parameters interact.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool gets enhanced recommendations using learning and knowledge graph, but it is vague. It does not specify what 'enhanced' means or differentiate from sibling tools like memory_knowledge_graph or memory_recall that also use knowledge graphs.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. The description lacks any context about prerequisites, such as whether memory must be populated first, or scenarios where this tool is preferred over other memory tools.

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/tosin2013/documcp'

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