Skip to main content
Glama

bridge_erc8004_trust_check

Verify ERC-8004 agent trust status with a verdict and score to assess reliability before interaction.

Instructions

Get an AgentStamp trust verdict for an ERC-8004 agent. Free. Returns trusted/untrusted with score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
erc8004_agent_idYesERC-8004 agent ID (numeric token ID)

Implementation Reference

  • The implementation of the bridge_erc8004_trust_check tool, which resolves an ERC-8004 agent to a wallet, checks for AgentStamp links/stamps/reputation, and returns a trust verdict.
    server.tool(
      'bridge_erc8004_trust_check',
      'Get an AgentStamp trust verdict for an ERC-8004 agent. Free. Returns trusted/untrusted with score.',
      {
        erc8004_agent_id: z.string().regex(/^\d+$/, 'Must be a numeric token ID').describe('ERC-8004 agent ID (numeric token ID)'),
      },
      async ({ erc8004_agent_id }) => {
        try {
          const { getFullAgent } = require('./erc8004');
          const { getDb, resolvePrimaryWallet, getAllLinkedWallets } = require('./database');
          const { computeDelegationBonus } = require('./reputation');
          const db = getDb();
    
          // Check local link first
          const link = db.prepare('SELECT agentstamp_wallet FROM erc8004_links WHERE erc8004_agent_id = ?').get(erc8004_agent_id);
          let wallet;
    
          if (link) {
            wallet = link.agentstamp_wallet;
          } else {
            // Resolve from on-chain
            const onChain = await getFullAgent(erc8004_agent_id);
            if (!onChain.found) {
              return { content: [{ type: 'text', text: JSON.stringify({ trusted: false, score: 0, error: 'Agent not found in ERC-8004 registry' }, null, 2) }] };
            }
            wallet = onChain.agentWallet || onChain.owner;
          }
    
          const resolvedWallet = resolvePrimaryWallet(wallet);
          const walletInfo = getAllLinkedWallets(resolvedWallet);
          const allWallets = walletInfo.all;
          if (allWallets.length === 0) {
            return { content: [{ type: 'text', text: JSON.stringify({ trusted: false, score: 0, label: 'unknown' }, null, 2) }] };
          }
    
          const ph = allWallets.map(() => '?').join(',');
          const agent = db.prepare(
            `SELECT id, name, category, endorsement_count, status, wallet_verified FROM agents WHERE wallet_address IN (${ph}) AND status = 'active' ORDER BY registered_at ASC LIMIT 1`
          ).get(...allWallets);
    
          const stamp = db.prepare(
            `SELECT id, tier, expires_at FROM stamps WHERE wallet_address IN (${ph}) 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);
    
          let reputation = { score: 0, tier_label: 'new' };
          if (agent) {
            const rep = computeReputation(agent.id);
            if (rep) reputation = rep;
          }
    
          const delegationBonus = computeDelegationBonus(resolvedWallet, db);
          const trusted = reputation.score >= 10 || !!stamp || delegationBonus.bonus > 0;
    
          const result = {
            trusted,
            score: reputation.score,
            label: reputation.tier_label,
            tier: stamp?.tier || 'none',
            erc8004_agent_id,
            agent: agent ? { id: agent.id, name: agent.name, category: agent.category, endorsements: agent.endorsement_count } : null,
            stamp: stamp ? { id: stamp.id, tier: stamp.tier, expires_at: stamp.expires_at } : null,
          };
    
          return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
        } catch (err) {
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses cost ('Free') and output format ('Returns trusted/untrusted with score'), but omits mutation vs read-only status, rate limits, auth requirements, or error behaviors.

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

Conciseness4/5

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

Three short sentences efficiently structured with purpose first, then cost, then return value. Slightly choppy with standalone 'Free.' but no wasted words; every sentence adds value beyond structured fields.

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?

For a single-parameter lookup tool with no output schema, the description adequately covers cost and return format. Missing only advanced details (pagination, error codes), but sufficient for tool selection given low complexity.

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 coverage is 100% with full parameter documentation (description, pattern validation), establishing baseline 3. Description adds no parameter-specific semantics but doesn't need to given complete schema coverage.

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

Purpose5/5

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

States specific verb (Get), resource (AgentStamp trust verdict), and target domain (ERC-8004 agent), clearly distinguishing from generic sibling 'trust_check' via explicit ERC-8004 scoping.

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?

Notes the tool is 'Free' and describes return values (trusted/untrusted with score), providing implicit context for when to use (ERC-8004 specific cases), but lacks explicit when-to-use guidance or comparison against sibling alternatives like 'trust_check'.

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