Skip to main content
Glama
agilesix
by agilesix
get-recipient-details.ts1.18 kB
/** * Get Recipient Details Tool * Retrieve detailed information about a specific recipient/contractor */ import { z } from 'zod'; import type { USASpendingClient } from '../clients/usaspending'; export function registerGetRecipientDetailsTool(server: any, client: USASpendingClient) { server.tool( "get_recipient_details", "Get detailed information about a specific recipient/contractor including their award history", { recipientHash: z.string().describe("The recipient hash ID from search_recipients"), }, async ({ recipientHash }: { recipientHash: string }) => { try { const recipient = await client.getRecipientDetails(recipientHash); if (!recipient) { return { content: [ { type: "text", text: `Recipient with hash ${recipientHash} not found`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(recipient, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } } ); }

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/agilesix/usaspending-mcp-nextjs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server