Skip to main content
Glama

get_passport

Retrieve a signed agent passport containing identity, reputation, and metadata for cross-protocol verification using an Ethereum wallet address.

Instructions

Get a signed cross-protocol agent passport. Contains identity, stamp, reputation, A2A card, and MCP metadata — all Ed25519-signed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_addressYesEthereum wallet address (0x...)

Implementation Reference

  • The MCP tool handler for 'get_passport' which accepts a wallet_address and calls generatePassport.
    async ({ wallet_address }) => {
      const passport = generatePassport(wallet_address);
      if (!passport) {
        return { content: [{ type: 'text', text: JSON.stringify({
          error: 'No active agent found for this wallet',
          trusted: false,
          message: 'This wallet has no AgentStamp identity. Register for free to get a verifiable passport.',
          register_url: 'https://agentstamp.org/register',
        }) }] };
      }
      return {
        content: [{ type: 'text', text: JSON.stringify(passport, null, 2) }],
      };
    }
  • The core logic implementation for generating a passport given a wallet address.
    function generatePassport(walletAddress) {
      const db = getDb();
    
      // Resolve to primary wallet and get all linked wallets
      const resolvedWallet = resolvePrimaryWallet(walletAddress);
      const walletInfo = getAllLinkedWallets(resolvedWallet);
      const allWallets = walletInfo.all;
      const placeholders = allWallets.map(() => '?').join(',');
    
      // Find agent across all linked wallets
      const agent = db.prepare(
        `SELECT * FROM agents WHERE wallet_address IN (${placeholders}) AND status = 'active' ORDER BY registered_at ASC LIMIT 1`
      ).get(...allWallets);
    
      if (!agent) return null;
    
      // Get best stamp across all linked wallets
      let stamp = null;
      const bestStamp = db.prepare(
        `SELECT id, tier, issued_at, expires_at, revoked FROM stamps WHERE wallet_address IN (${placeholders}) AND revoked = 0 AND expires_at > datetime('now') ORDER BY CASE tier WHEN 'gold' THEN 1 WHEN 'silver' THEN 2 WHEN 'bronze' THEN 3 WHEN 'free' THEN 4 ELSE 5 END LIMIT 1`
      ).get(...allWallets);
      if (bestStamp) stamp = bestStamp;
      else if (agent.stamp_id) {
        stamp = db.prepare(
          'SELECT id, tier, issued_at, expires_at, revoked FROM stamps WHERE id = ?'
        ).get(agent.stamp_id);
      }
    
      // Compute reputation
      const reputation = computeReputation(agent.id);
    
      // Parse stored JSON fields
      const capabilities = JSON.parse(agent.capabilities || '[]');
      const protocols = JSON.parse(agent.protocols || '[]');
      const metadata = JSON.parse(agent.metadata || '{}');
    
      // Build the passport document
      const now = new Date().toISOString();
    
      const passportData = {
        // Header
        version: '1.0',
        type: 'AgentPassport',
        issued_at: now,
        issuer: 'https://agentstamp.org',
    
        // Identity
        agent: {
          id: agent.id,
          name: agent.name,
          description: agent.description,
          wallet_address: agent.wallet_address,
          category: agent.category,
          capabilities,
          protocols,
          endpoint_url: agent.endpoint_url,
          status: agent.status,
          registered_at: agent.registered_at,
          expires_at: agent.expires_at,
        },
  • Registration of the 'get_passport' MCP tool.
    server.tool(
      'get_passport',
      'Get a signed cross-protocol agent passport. Contains identity, stamp, reputation, A2A card, and MCP metadata — all Ed25519-signed.',
      {
        wallet_address: z.string().describe('Ethereum wallet address (0x...)'),
      },
      async ({ wallet_address }) => {
        const passport = generatePassport(wallet_address);
        if (!passport) {
          return { content: [{ type: 'text', text: JSON.stringify({
            error: 'No active agent found for this wallet',
            trusted: false,
            message: 'This wallet has no AgentStamp identity. Register for free to get a verifiable passport.',
            register_url: 'https://agentstamp.org/register',
          }) }] };
        }
        return {
          content: [{ type: 'text', text: JSON.stringify(passport, null, 2) }],
        };
      }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. Adds valuable cryptographic context (Ed25519-signed) and data composition details. However, unclear whether this retrieves an existing passport or creates/issues a new one (critical ambiguity for a blockchain-adjacent tool). No disclosure of auth requirements or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with zero redundancy. Front-loads the action ('Get a signed...'), follows with content specification, and ends with cryptographic verification detail. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Compensates well for missing output schema by enumering return contents and signing mechanism. Single parameter with full schema coverage reduces complexity. Deducted point for ambiguity regarding state mutation (read vs. write) given the 'Get' terminology in a web3 context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage for the single wallet_address parameter. Description adds no parameter-specific details, relying entirely on schema documentation. Baseline score of 3 is appropriate given schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ('Get') and detailed resource description ('signed cross-protocol agent passport'). Lists specific contents (identity, stamp, reputation, A2A card, MCP metadata) and cryptographic properties (Ed25519-signed) that distinguish it from sibling tools like get_agent or get_agent_reputation. Lacks explicit comparison to siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternative recommendations. However, the detailed content list provides implied usage guidance—agents can infer to use this when needing the comprehensive package of identity + reputation + stamps versus subset tools like get_agent_reputation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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