Skip to main content
Glama

commerce_recall

Retrieve past commerce feedback with quality scores to inform product recommendations, brand compliance, sizing, pricing, and regulatory decisions.

Instructions

Recall past feedback filtered by commerce categories (product_recommendation, brand_compliance, sizing, pricing, regulatory). Returns quality scores alongside memories for agentic commerce agents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesProduct or brand context to find relevant past feedback
categoriesNoCommerce categories to filter (default: all commerce categories)
limitNoMax memories to return (default 5)

Implementation Reference

  • The function that implements the logic for 'commerce_recall', aggregating quality scores based on commerce feedback.
    function buildCommerceRecallResponse(args = {}) {
      const requestedCategories = Array.isArray(args.categories) && args.categories.length > 0
        ? args.categories
        : COMMERCE_CATEGORIES;
      const modelPath = path.join(SAFE_DATA_DIR, 'feedback_model.json');
      const reliability = getReliability(loadModel(modelPath));
      const lines = ['## Commerce Quality Scores', ''];
    
      for (const category of requestedCategories) {
        const stats = reliability[category];
        if (!stats) continue;
        const successRate = typeof stats.success_rate === 'number'
          ? `${(stats.success_rate * 100).toFixed(1)}%`
          : 'n/a';
        lines.push(`- ${category}: ${successRate} success rate over ${stats.total || 0} samples`);
      }
    
      if (lines.length === 2) {
        lines.push('- No commerce quality scores recorded yet.');
      }
    
      lines.push('');
      lines.push(`Query: ${args.query || ''}`);
      return toTextResult(lines.join('\n'));
  • The tool registration and schema definition for 'commerce_recall'.
    readOnlyTool({
      name: 'commerce_recall',
      description: 'Recall past feedback filtered by commerce categories (product_recommendation, brand_compliance, sizing, pricing, regulatory). Returns quality scores alongside memories for agentic commerce agents.',
      inputSchema: {
        type: 'object',
        required: ['query'],
        properties: {
          query: { type: 'string', description: 'Product or brand context to find relevant past feedback' },
          categories: { type: 'array', items: { type: 'string' }, description: 'Commerce categories to filter (default: all commerce categories)' },
          limit: { type: 'number', description: 'Max memories to return (default 5)' },
        },
      },
    }),
  • The switch-case handler that calls the implementation function when the 'commerce_recall' tool is invoked.
    case 'commerce_recall':
      return buildCommerceRecallResponse(args);

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/IgorGanapolsky/mcp-memory-gateway'

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