usas_get_recipient_profile
Retrieve complete recipient profile including alternate names, DUNS, UEI, parent organization, business types, location, and financial totals by providing a recipient ID from a prior search.
Instructions
Full recipient detail by recipient_id (from usas_search_recipients). Returns alternate_names (M&A history), DUNS, UEI, parent linkage, business_types, location, total_amount, total_transactions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recipientId | Yes | From usas_search_recipients — e.g. 'ed02855e-...-P' |
Implementation Reference
- src/server.ts:184-186 (schema)Input schema for usas_get_recipient_profile — validates recipientId string from usas_search_recipients.
const UsasGetRecipientInput = z.object({ recipientId: z.string().describe("From usas_search_recipients — e.g. 'ed02855e-...-P'"), }); - src/server.ts:433-438 (registration)Tool registration in the TOOLS array — maps the name 'usas_get_recipient_profile' to its description and inputSchema.
{ name: "usas_get_recipient_profile", description: "Full recipient detail by recipient_id (from usas_search_recipients). Returns alternate_names (M&A history), DUNS, UEI, parent linkage, business_types, location, total_amount, total_transactions.", inputSchema: UsasGetRecipientInput, }, - src/server.ts:749-752 (registration)Case handler in runTool() switch — calls usas.getRecipientProfile() with the parsed recipientId.
case "usas_get_recipient_profile": return await usas.getRecipientProfile( UsasGetRecipientInput.parse(args).recipientId, ); - src/usaspending.ts:736-774 (handler)Actual handler function: getRecipientProfile(recipientId) — calls USAspending GET /recipient/{id}/ and returns full recipient details including alternate_names, DUNS, UEI, parent linkage, business_types, location, total_amount, total_transactions.
export async function getRecipientProfile(recipientId: string) { type Resp = { name?: string; alternate_names?: string[]; duns?: string; uei?: string; recipient_id?: string; recipient_level?: string; parent_id?: string; parent_name?: string; business_types?: string[]; location?: { address_line1?: string; city_name?: string; state_code?: string; country_name?: string; zip5?: string; }; total_transaction_amount?: number; total_transactions?: number; }; const json = await getUsas<Resp>( `recipient/${encodeURIComponent(recipientId)}/`, ); return { name: json.name ?? "", alternateNames: json.alternate_names ?? [], duns: json.duns, uei: json.uei, recipientId: json.recipient_id, level: json.recipient_level, parentId: json.parent_id, parentName: json.parent_name, businessTypes: json.business_types ?? [], location: json.location ?? {}, totalAmount: json.total_transaction_amount ?? 0, totalTransactions: json.total_transactions ?? 0, }; } - src/server.ts:28-28 (helper)Import of the usas module which contains the getRecipientProfile handler function.
import * as usas from "./usaspending.js";