trust_compare
Compare trust scores for 2-5 wallet addresses to identify leaders, score gaps, and unregistered agents.
Instructions
Compare trust scores of up to 5 wallets side-by-side. See who leads, the score gap, and which agents are unregistered.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallets | Yes | Array of 2-5 wallet addresses to compare |
Implementation Reference
- src/mcp-server.js:280-330 (handler)The tool 'trust_compare' is registered and implemented in src/mcp-server.js, which fetches agent/stamp data from the database and calculates relative trust rankings.
server.tool( 'trust_compare', 'Compare trust scores of up to 5 wallets side-by-side. See who leads, the score gap, and which agents are unregistered.', { wallets: z.array(z.string()).min(2).max(5).describe('Array of 2-5 wallet addresses to compare'), }, async ({ wallets }) => { const { getDb } = require('./database'); const db = getDb(); const results = wallets.map(wallet => { const stamp = db.prepare( "SELECT tier 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); const agent = db.prepare( "SELECT id, name, endorsement_count FROM agents WHERE wallet_address = ? AND status = 'active' LIMIT 1" ).get(wallet); let reputation = { score: 0, tier_label: 'unknown' }; if (agent) { const rep = computeReputation(agent.id); if (rep) reputation = rep; } return { wallet: wallet.slice(0, 6) + '...' + wallet.slice(-4), registered: !!agent, stamped: !!stamp, tier: stamp?.tier || 'none', name: agent?.name || null, score: reputation.score, label: agent ? reputation.tier_label : 'unknown', endorsements: agent?.endorsement_count || 0, }; }); results.sort((a, b) => b.score - a.score); const unregistered = results.filter(r => !r.registered); return { content: [{ type: 'text', text: JSON.stringify({ comparison: results, leader: results[0], gap: results.length >= 2 ? results[0].score - results[results.length - 1].score : 0, unregistered_count: unregistered.length, nudge: unregistered.length > 0 ? `${unregistered.length} agent(s) are not registered. They have 0 trust score. Register free: https://agentstamp.org/register` : null, }, null, 2) }], };