Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

usas_search_recipients

Search USAspending recipients by keyword with parent/child/recipient hierarchy. Returns recipient IDs, DUNS, UEI, level, and total amount to use before retrieving recipient profile.

Instructions

Search USAspending recipient list with parent/child/recipient hierarchy. Returns recipients with id, duns, uei, level (P=parent, C=child, R=recipient), total_amount. Use for 'find the recipient_id for Booz Allen' before usas_get_recipient_profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes
recipientLevelNoP=parent, C=child, R=recipient
limitNo

Implementation Reference

  • The actual handler function 'searchRecipients' that executes the tool logic. It POSTs to USAspending's 'recipient/' endpoint with keyword, optional recipientLevel, and limit. Returns recipients with id, duns, uei, name, level, totalAmount.
    export async function searchRecipients(args: {
      keyword: string;
      recipientLevel?: "P" | "C" | "R";
      limit?: number;
    }) {
      type Resp = {
        page_metadata?: { total?: number };
        results?: {
          id?: string;
          duns?: string;
          uei?: string;
          name?: string;
          recipient_level?: string;
          amount?: number;
        }[];
      };
      const body: Record<string, unknown> = {
        keyword: args.keyword,
        limit: args.limit ?? 10,
        page: 1,
      };
      if (args.recipientLevel) {
        body.recipient_level = args.recipientLevel;
      }
      const json = await postUsas<Resp>("recipient/", body);
      return {
        totalRecords: json.page_metadata?.total ?? 0,
        recipients: (json.results ?? []).map((r) => ({
          id: r.id ?? "",
          duns: r.duns,
          uei: r.uei,
          name: r.name ?? "",
          level: r.recipient_level,
          totalAmount: r.amount ?? 0,
        })),
      };
    }
  • Zod input schema 'UsasSearchRecipientsInput' defining the tool's inputs: keyword (string, required), recipientLevel (enum P/C/R, optional), and limit (number, optional).
    const UsasSearchRecipientsInput = z.object({
      keyword: z.string(),
      recipientLevel: z
        .enum(["P", "C", "R"])
        .optional()
        .describe("P=parent, C=child, R=recipient"),
      limit: z.number().min(1).max(50).optional(),
    });
  • src/server.ts:427-432 (registration)
    Tool registration/definition in the tools array: name 'usas_search_recipients', description, and inputSchema reference.
    {
      name: "usas_search_recipients",
      description:
        "Search USAspending recipient list with parent/child/recipient hierarchy. Returns recipients with id, duns, uei, level (P=parent, C=child, R=recipient), total_amount. Use for 'find the recipient_id for Booz Allen' before usas_get_recipient_profile.",
      inputSchema: UsasSearchRecipientsInput,
    },
  • src/server.ts:747-748 (registration)
    Dispatch case in the CallToolRequestSchema handler: maps 'usas_search_recipients' to usas.searchRecipients() with parsed input.
    case "usas_search_recipients":
      return await usas.searchRecipients(UsasSearchRecipientsInput.parse(args));
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries the burden. It discloses return fields and the meaning of the level parameter. However, it does not mention pagination, empty results, rate limits, or error behavior. For a search tool, this is mostly acceptable but could be more explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first covers purpose and output, second gives usage example. No wasted words, front-loaded with core information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (search, 3 params, no output schema), the description covers purpose, output fields, and a usage example. It lacks explanation of the limit parameter and handling of no results, but is largely sufficient for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is low (33%), only recipientLevel has a description. The description adds meaning to the output fields but does not explain keyword or limit parameters beyond the schema. It provides context on what the search returns, which helps, but leaves parameter usage vague.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches the USAspending recipient list with hierarchy (parent/child/recipient) and lists specific return fields (id, duns, uei, level, total_amount). It also specifies the use case before using usas_get_recipient_profile, differentiating it from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use for find the recipient_id for Booz Allen before usas_get_recipient_profile', providing a concrete scenario and recommended workflow. This tells the agent when to use this tool versus the sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cliwant/mcp-sam-gov'

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