Skip to main content
Glama

get_agent

Retrieve complete agent profiles with endorsements and reputation scores to verify identity and trustworthiness in AI agent networks.

Instructions

Get full agent profile by ID, including endorsements and reputation score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe agent ID (e.g., agt_E-PFtTAIQlfVleNm)

Implementation Reference

  • The implementation of the getAgentById function which fetches the full agent profile, including endorsements and reputation, used by the "get_agent" MCP tool.
    function getAgentById(agentId) {
      const db = getDb();
      const agent = db.prepare('SELECT * FROM agents WHERE id = ?').get(agentId);
      if (!agent) return null;
    
      const parsed = parseAgent(agent);
      const endorsements = db.prepare(
        'SELECT endorser_wallet, message, created_at FROM endorsements WHERE agent_id = ? ORDER BY created_at DESC'
      ).all(agentId);
      const reputation = computeReputation(agentId);
    
      return { ...parsed, endorsements, reputation };
    }
  • Registration and MCP tool handler logic for 'get_agent'. It calls the queries.getAgentById method to retrieve the agent data.
    // --- Tool: get_agent ---
    server.tool(
      'get_agent',
      'Get full agent profile by ID, including endorsements and reputation score.',
      {
        agent_id: z.string().describe('The agent ID (e.g., agt_E-PFtTAIQlfVleNm)'),
      },
      async ({ agent_id }) => {
        const agent = queries.getAgentById(agent_id);
        if (!agent) {
          return { content: [{ type: 'text', text: JSON.stringify({ error: 'Agent not found' }) }] };
        }
        return {
          content: [{ type: 'text', text: JSON.stringify(agent, 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