trust_network
Analyze network-wide trust statistics including total agents, stamps, endorsements, and average reputation to provide social proof for the AgentStamp ecosystem.
Instructions
Network-wide trust statistics: total agents, stamps, endorsements, wishes, average reputation, top categories. Social proof for the AgentStamp network.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.js:335-371 (handler)The handler implementation for the 'trust_network' MCP tool, which queries the database for network-wide statistics such as active agents, stamps, endorsements, and wishes, and returns them as a JSON string.
server.tool( 'trust_network', 'Network-wide trust statistics: total agents, stamps, endorsements, wishes, average reputation, top categories. Social proof for the AgentStamp network.', {}, async () => { const { getDb } = require('./database'); const db = getDb(); const agents = db.prepare("SELECT COUNT(*) as count FROM agents WHERE status = 'active'").get(); const stamps = db.prepare("SELECT COUNT(*) as count FROM stamps WHERE revoked = 0 AND expires_at > datetime('now')").get(); const endorsements = db.prepare('SELECT COUNT(*) as count FROM endorsements').get(); const wishes = db.prepare('SELECT COUNT(*) as count FROM wishes').get(); const wishesGranted = db.prepare('SELECT COUNT(*) as count FROM wishes WHERE granted = 1').get(); const topCategories = db.prepare( "SELECT category, COUNT(*) as count FROM agents WHERE status = 'active' AND category IS NOT NULL GROUP BY category ORDER BY count DESC LIMIT 5" ).all(); return { content: [{ type: 'text', text: JSON.stringify({ network: { active_agents: agents.count, active_stamps: stamps.count, total_endorsements: endorsements.count, total_wishes: wishes.count, wishes_granted: wishesGranted.count, }, top_categories: topCategories, message: `${agents.count} agents trust AgentStamp. Join them.`, register_url: 'https://agentstamp.org/register', }, null, 2) }], }; } ); // --- Tool: bridge_erc8004_lookup --- server.tool(