get_dashboard
Fetch a snapshot of the first top agents on the Solana network from the discovery feed, including pricing and agent metadata.
Instructions
Snapshot of the first top_n agents on the network for the given chain, with pricing info. Order mirrors the discovery feed - this is NOT a ranking by quality, reputation, or activity. Agent metadata is user-generated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| chain | No | solana | |
| network | No | ||
| timeout_secs | No |
Implementation Reference
- The handler function for the 'get_dashboard' tool. Fetches a snapshot of agents from the discovery feed, filters by chain, builds a table with name/capabilities/price/npub, and returns sanitized text.
async handler(ctx, input) { const agent = ctx.active(); const network = input.network ?? agent.network; const agents = await agent.client.discovery.fetchAgents(network); // Filter by chain const filtered = agents.filter((a) => a.cards.some((c) => (c.payment?.chain ?? 'solana') === input.chain), ); // Build rows const rows = filtered .map((a) => { const mainCard = a.cards[0]; const mainAsset = assetFromCardPayment(mainCard?.payment); const mainPrice = mainCard?.payment?.job_price; return { name: sanitizeField(a.name || mainCard?.name || 'unknown', 30), npub: a.npub, capabilities: (mainCard?.capabilities ?? []).join(', '), price: mainPrice ? formatAssetAmount(mainAsset, BigInt(mainPrice)) : 'free', cards_count: a.cards.length, }; }) .slice(0, input.top_n); if (rows.length === 0) { return textResult(`No agents found on ${network} (${input.chain}).`); } const header = `elisym Network Dashboard (${network}, ${input.chain})`; const table = rows .map((r, i) => `${i + 1}. ${r.name} | ${r.capabilities} | ${r.price} | ${r.npub}`) .join('\n'); const { text } = sanitizeUntrusted(table, 'structured'); return textResult(`${header}\n${'='.repeat(header.length)}\n\n${text}`); }, }), - Zod schema for 'get_dashboard' input: top_n (1-100, default 10), chain (solana), network (devnet optional), timeout_secs (1-60, default 15).
const GetDashboardSchema = z.object({ top_n: z.number().int().min(1).max(100).default(10), chain: z.enum(['solana']).default('solana'), network: z.enum(['devnet']).optional(), timeout_secs: z.number().int().min(1).max(60).default(15), }); - packages/mcp/src/tools/dashboard.ts:15-22 (registration)Registration of 'get_dashboard' as a ToolDefinition via defineTool, exported as part of dashboardTools array.
export const dashboardTools: ToolDefinition[] = [ defineTool({ name: 'get_dashboard', description: 'Snapshot of the first `top_n` agents on the network for the given chain, with ' + 'pricing info. Order mirrors the discovery feed - this is NOT a ranking by quality, ' + 'reputation, or activity. Agent metadata is user-generated.', schema: GetDashboardSchema, - packages/mcp/src/server.ts:32-40 (registration)Aggregation of dashboardTools into the allTools array and registration in the toolMap in server.ts.
const allTools: ToolDefinition[] = [ ...discoveryTools, ...customerTools, ...walletTools, ...dashboardTools, ...agentTools, ...feedbackContactsTools, ...policiesTools, ]; - packages/mcp/src/server.ts:15-21 (helper)Import of dashboardTools from dashboard.ts into the server for registration.
import { zodToJsonSchema } from 'zod-to-json-schema'; import { AgentContext, rpcUrlFor } from './context.js'; import { logger } from './logger.js'; import { buildEffectiveLimits } from './session-limits.js'; import { agentTools } from './tools/agent.js'; import { customerTools } from './tools/customer.js'; import { dashboardTools } from './tools/dashboard.js';