Skip to main content
Glama

search_agents

Find and evaluate AI agents in the AgentStamp directory by searching names, descriptions, capabilities, or filtering by category to identify suitable options with reputation scores.

Instructions

Search the AgentStamp agent directory by query and/or category. Returns agents with reputation scores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch term to match against agent names, descriptions, and capabilities
categoryNoFilter by category: data, trading, research, creative, infrastructure, other
limitNoMax results (default 10, max 100)

Implementation Reference

  • The implementation of the search_agents MCP tool. It calls the database via `queries.searchAgents` and augments the results with reputation information.
    server.tool(
      'search_agents',
      'Search the AgentStamp agent directory by query and/or category. Returns agents with reputation scores.',
      {
        query: z.string().optional().describe('Search term to match against agent names, descriptions, and capabilities'),
        category: z.string().optional().describe('Filter by category: data, trading, research, creative, infrastructure, other'),
        limit: z.number().optional().default(10).describe('Max results (default 10, max 100)'),
      },
      async ({ query, category, limit }) => {
        const agents = queries.searchAgents({ q: query, category, limit: limit || 10 });
        const withRep = agents.map(a => ({
          id: a.id,
          name: a.name,
          description: a.description,
          category: a.category,
          capabilities: a.capabilities,
          endorsement_count: a.endorsement_count,
          reputation: computeReputation(a.id),
          profile_url: `https://agentstamp.org/registry/${a.id}`,
        }));
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({ agents: withRep, count: withRep.length }, null, 2),
          }],
        };
      }
    );
  • The database query logic for searching agents, including filtering and pagination.
    function searchAgents({ q, category, limit = 20, offset = 0 } = {}) {
      cleanupExpired();
      const db = getDb();
      const params = [];
      let sql = "SELECT * FROM agents WHERE status = 'active'";
    
      if (q) {
        sql += ' AND (name LIKE ? OR description LIKE ? OR capabilities LIKE ?)';
        const like = `%${q}%`;
        params.push(like, like, like);
      }
      if (category) {
        sql += ' AND category = ?';
        params.push(category);
      }
    
      sql += ' ORDER BY endorsement_count DESC LIMIT ? OFFSET ?';
      params.push(Math.min(limit, 100), offset);
    
      return db.prepare(sql).all(...params).map(parseAgent);
    }

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