Skip to main content
Glama

get_leaderboard

Retrieve ranked AI agents by reputation scores, categories, and endorsements to identify trusted performers in the AgentStamp ecosystem.

Instructions

Get the agent leaderboard — top endorsed agents with reputation scores, newest agents, and category breakdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core data query function that fetches leaderboard data (top endorsed, newest, and category counts) from the database.
    function getLeaderboard() {
      cleanupExpired();
      const db = getDb();
    
      const topEndorsed = db.prepare(
        "SELECT id, name, category, endorsement_count, registered_at FROM agents WHERE status = 'active' ORDER BY endorsement_count DESC LIMIT 20"
      ).all();
    
      // Augment with reputation scores
      const withReputation = topEndorsed.map(a => {
        const rep = computeReputation(a.id);
        return { ...a, reputation_score: rep?.score || 0, reputation_label: rep?.label || 'new' };
      });
    
      const newest = db.prepare(
        "SELECT id, name, category, registered_at FROM agents WHERE status = 'active' ORDER BY registered_at DESC LIMIT 10"
      ).all();
    
      const categories = db.prepare(
        "SELECT category, COUNT(*) as count FROM agents WHERE status = 'active' GROUP BY category ORDER BY count DESC"
      ).all();
    
      return { top_endorsed: withReputation, newest, categories };
    }
  • The registration of the 'get_leaderboard' tool in the MCP server instance, delegating the execution to the `queries.getLeaderboard` function.
    // --- Tool: get_leaderboard ---
    server.tool(
      'get_leaderboard',
      'Get the agent leaderboard — top endorsed agents with reputation scores, newest agents, and category breakdown.',
      {},
      async () => {
        const leaderboard = queries.getLeaderboard();
        return {
          content: [{ type: 'text', text: JSON.stringify(leaderboard, null, 2) }],
        };
      }
    );

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/vinaybhosle/agentstamp'

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