Skip to main content
Glama

verify_stamp

Verify AgentStamp identity certificates using stamp IDs to confirm authenticity and trustworthiness of AI agents.

Instructions

Verify an AgentStamp identity certificate by its stamp ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stamp_idYesThe stamp ID to verify (e.g., stmp_QLNhL-Y1CvlyWxnG)

Implementation Reference

  • The implementation of the `verify_stamp` tool in the MCP server. It retrieves a stamp from the database, validates its certificate and expiration, and returns the result.
    // --- Tool: verify_stamp ---
    server.tool(
      'verify_stamp',
      'Verify an AgentStamp identity certificate by its stamp ID.',
      {
        stamp_id: z.string().describe('The stamp ID to verify (e.g., stmp_QLNhL-Y1CvlyWxnG)'),
      },
      async ({ stamp_id }) => {
        const { getDb } = require('./database');
        const { verifyCertificate, getPublicKey } = require('./crypto');
        const db = getDb();
    
        const stamp = db.prepare('SELECT * FROM stamps WHERE id = ?').get(stamp_id);
        if (!stamp) {
          return { content: [{ type: 'text', text: JSON.stringify({ error: 'Stamp not found' }) }] };
        }
    
        const certificate = JSON.parse(stamp.certificate);
        const isValid = verifyCertificate(certificate, stamp.signature);
        const isExpired = new Date(stamp.expires_at) < new Date();
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              stamp_id: stamp.id,
              tier: stamp.tier,
              wallet_address: stamp.wallet_address,
              issued_at: stamp.issued_at,
              expires_at: stamp.expires_at,
              valid: isValid && !isExpired && !stamp.revoked,
              expired: isExpired,
              revoked: !!stamp.revoked,
              signature_valid: isValid,
              public_key: getPublicKey(),
            }, 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