Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

usas_search_individual_awards

Retrieve detailed line-item federal contracts from USAspending. Use after a general awards search to get actual contracts with recipient, dollar amount, sub-agency, state, and description.

Instructions

Line-item federal contracts on USAspending. Returns specific awards (recipient + $ + sub-agency + state + description). Use AFTER usas_search_awards when the user wants 'show me the actual contracts'. Each result includes a generatedInternalId for usas_get_award_detail follow-ups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agencyNoCanonical agency name
naicsNo
fiscalYearNo
setAsideNo
limitNo

Implementation Reference

  • The actual handler function `searchIndividualAwards` that executes the tool logic. It calls USAspending's `search/spending_by_award` endpoint (POST keyless) with agency/naics/fiscalYear/setAside/limit filters, then maps the response (Award ID, Recipient Name, Award Amount, etc.) into a structured result with a generatedInternalId for follow-up lookups.
    export async function searchIndividualAwards(args: {
      agency?: string;
      naics?: string;
      fiscalYear?: number;
      setAside?: string;
      limit?: number;
    }) {
      const filters = buildFilters(args);
      type Resp = {
        results?: {
          "Award ID"?: string;
          "Recipient Name"?: string;
          "Award Amount"?: number;
          "Awarding Agency"?: string;
          "Awarding Sub Agency"?: string;
          "Place of Performance State Code"?: string;
          Description?: string;
          generated_internal_id?: string;
        }[];
      };
      const json = await postUsas<Resp>("search/spending_by_award", {
        filters,
        fields: [
          "Award ID",
          "Recipient Name",
          "Award Amount",
          "Awarding Agency",
          "Awarding Sub Agency",
          "Place of Performance State Code",
          "Description",
        ],
        limit: args.limit ?? 10,
        page: 1,
        subawards: false,
      });
      return {
        awards: (json.results ?? []).map((r) => ({
          awardId: r["Award ID"] ?? "",
          recipient: r["Recipient Name"] ?? "",
          amount: r["Award Amount"] ?? 0,
          awardingAgency: r["Awarding Agency"] ?? "",
          awardingSubAgency: r["Awarding Sub Agency"],
          placeOfPerformanceState: r["Place of Performance State Code"],
          description: r.Description,
          generatedInternalId: r.generated_internal_id ?? "",
        })),
      };
    }
  • The `runTool` switch-case that dispatches `usas_search_individual_awards` to `usas.searchIndividualAwards()` with parsed `UsasIndividualAwardsInput` arguments.
    case "usas_search_individual_awards":
      return await usas.searchIndividualAwards(
        UsasIndividualAwardsInput.parse(args),
      );
    case "usas_search_subagency_spending":
  • Input schema `UsasIndividualAwardsInput` extending `UsasFiltersBase` with an optional `limit` (1-50). Defines the shape of arguments the tool accepts: agency, naics, fiscalYear, setAside, and limit.
    const UsasIndividualAwardsInput = UsasFiltersBase.extend({
      limit: z.number().min(1).max(50).optional(),
    });
  • Base schema `UsasFiltersBase` used by `UsasIndividualAwardsInput`. Defines agency (string), naics (string), fiscalYear (int 2007+), and setAside (enum of SBA/8A/HZS/SDVOSBC/WOSB/EDWOSB/VSA/VSS) fields.
    const UsasFiltersBase = z.object({
      agency: z.string().optional().describe("Canonical agency name"),
      naics: z.string().optional(),
      fiscalYear: z.number().int().min(2007).optional(),
      setAside: z
        .enum(["SBA", "8A", "HZS", "SDVOSBC", "WOSB", "EDWOSB", "VSA", "VSS"])
        .optional(),
    });
  • src/server.ts:325-330 (registration)
    Tool registration entry in the `TOOLS` array: defines the name `usas_search_individual_awards`, description, and links to its input schema.
    {
      name: "usas_search_individual_awards",
      description:
        "Line-item federal contracts on USAspending. Returns specific awards (recipient + $ + sub-agency + state + description). Use AFTER usas_search_awards when the user wants 'show me the actual contracts'. Each result includes a generatedInternalId for usas_get_award_detail follow-ups.",
      inputSchema: UsasIndividualAwardsInput,
    },
Behavior4/5

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

No annotations are provided, so the description bears full burden. It describes the output (specific awards with fields) and mentions generatedInternalId for follow-ups, but does not explicitly state read-only nature or auth needs. However, as a search tool, it is implicitly read-only and safe, so the lack of explicit safety info is a minor gap.

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?

The description is two sentences, both valuable. The first sentence states the purpose, the second gives usage guidance and follow-up info. No fluff or repetition.

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 no output schema, the description explains return fields and the generatedInternalId for follow-ups. It references sibling tool and provides usage context. However, it lacks parameter explanation, which is a gap given low schema coverage. Still covers core essentials.

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

Parameters2/5

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

Schema description coverage is only 20%, meaning most parameters lack description in the schema. The description does not add meaning to the parameters beyond what is in the schema. It only mentions output fields, not how to use the parameters. This fails to compensate for the low schema coverage.

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 it returns line-item federal contracts with specific fields (recipient, $, sub-agency, state, description) and explicitly distinguishes from sibling tool usas_search_awards by stating 'Use AFTER usas_search_awards when the user wants show me the actual contracts.'

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?

The description explicitly instructs when to use this tool: 'Use AFTER usas_search_awards when the user wants show me the actual contracts.' This provides clear context and alternatives.

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