trust_check
Verify wallet address trust status with a single call. Get trust verdict, reputation score, tier level, and profile information for AI agents.
Instructions
Single-call trust verdict for any wallet address. Returns whether the agent is trusted, their score, tier, and profile info. Unregistered agents get trusted: false with a registration CTA.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_address | Yes | Wallet address to check trust status for |
Implementation Reference
- src/mcp-server.js:220-276 (handler)The `trust_check` tool implementation. It performs a database lookup to check if a wallet is associated with a stamp or a registered agent, computes a reputation score, and returns the trust verdict, including score, tier, and agent/stamp details if available.
server.tool( 'trust_check', 'Single-call trust verdict for any wallet address. Returns whether the agent is trusted, their score, tier, and profile info. Unregistered agents get trusted: false with a registration CTA.', { wallet_address: z.string().describe('Wallet address to check trust status for'), }, async ({ wallet_address }) => { const { getDb } = require('./database'); const db = getDb(); const stamp = db.prepare( "SELECT id, tier, expires_at FROM stamps WHERE wallet_address = ? 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(wallet_address); const agent = db.prepare( "SELECT id, name, category, endorsement_count, status, registered_at FROM agents WHERE wallet_address = ? AND status = 'active' LIMIT 1" ).get(wallet_address); if (!stamp && !agent) { return { content: [{ type: 'text', text: JSON.stringify({ trusted: false, score: 0, tier: null, label: 'unknown', message: 'This wallet has no AgentStamp identity. The agent is unverified and not in the public registry.', action: { register: 'https://agentstamp.org/register', message: 'Register for free in 60 seconds to become trusted and discoverable.', }, }, null, 2) }] }; } let reputation = { score: 0, tier_label: 'new', breakdown: null }; if (agent) { const rep = computeReputation(agent.id); if (rep) reputation = rep; } const trusted = reputation.score >= 10 || !!stamp; return { content: [{ type: 'text', text: JSON.stringify({ trusted, score: reputation.score, tier: stamp?.tier || 'none', label: reputation.tier_label, agent: agent ? { id: agent.id, name: agent.name, category: agent.category, endorsements: agent.endorsement_count, profile_url: `https://agentstamp.org/registry/${agent.id}`, } : null, stamp: stamp ? { id: stamp.id, tier: stamp.tier, expires_at: stamp.expires_at } : null, }, null, 2) }], }; }