Skip to main content
Glama

feedback_stats

Analyze feedback data to generate actionable insights and recommendations for improving user experience and system performance.

Instructions

Get feedback stats and recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `handleFeedbackStats` function retrieves recent feedback, calculates up/down vote counts, and aggregates tag frequencies to return a summary of feedback statistics.
    async function handleFeedbackStats(
      params: Record<string, unknown>,
      ownerId: string,
      env: Env,
    ): Promise<ToolResult> {
      const limit = (params.limit as number) ?? 100;
      const entries = await listFeedback(env, ownerId, limit);
    
      const up = entries.filter((e) => e.feedback === 'up').length;
      const down = entries.filter((e) => e.feedback === 'down').length;
      const total = entries.length;
    
      const tagCounts: Record<string, number> = {};
      for (const entry of entries) {
        for (const tag of entry.tags) {
          tagCounts[tag] = (tagCounts[tag] ?? 0) + 1;
        }
      }
    
      const topTags = Object.entries(tagCounts)
        .sort((a, b) => b[1] - a[1])
        .slice(0, 10)
        .map(([tag, count]) => ({ tag, count }));
    
      return textResult(
        JSON.stringify({
          total,
          up,
          down,
          ratio: total > 0 ? (up / total).toFixed(2) : '0.00',
          topTags,
        }),
      );
    }
  • Tool registration for 'feedback_stats' in the main MCP handler switch block.
    case 'feedback_stats':
      return handleFeedbackStats(params, ownerId, env);
    case 'prevention_rules':

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