Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

usas_search_subawards

Search subcontracts awarded under prime contracts to uncover teaming networks. Specify prime recipient, agency, or NAICS to identify subrecipients and small business participation on federal awards.

Instructions

Enumerate subcontracts on prime awards. Use for 'who teams with Leidos at DISA' or 'show small-business subs on Accenture's DHS contracts' — surfaces the prime/sub network for teaming-map artifacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
primeRecipientNameNo
agencyNo
naicsNo
fiscalYearNo
limitNo

Implementation Reference

  • src/server.ts:349-353 (registration)
    Tool registration for 'usas_search_subawards' in the TOOLS array. Defines name, description (enumerate subcontracts on prime awards), and associates it with UsasSubawardsInput schema.
    {
      name: "usas_search_subawards",
      description:
        "Enumerate subcontracts on prime awards. Use for 'who teams with Leidos at DISA' or 'show small-business subs on Accenture's DHS contracts' — surfaces the prime/sub network for teaming-map artifacts.",
      inputSchema: UsasSubawardsInput,
  • Zod input schema UsasSubawardsInput — validates primeRecipientName, agency, naics, fiscalYear, and limit (1-50).
    const UsasSubawardsInput = z.object({
      primeRecipientName: z.string().optional(),
      agency: z.string().optional(),
      naics: z.string().optional(),
      fiscalYear: z.number().int().min(2007).optional(),
      limit: z.number().min(1).max(50).optional(),
    });
  • searchSubawards() — the actual tool handler. Builds filters from args, adds recipient_search_text if primeRecipientName is provided, then POSTs to 'search/spending_by_award' with subawards:true. Maps results to subAwardId, subRecipient, amount, actionDate, primeAwardId.
    export async function searchSubawards(args: {
      primeRecipientName?: string;
      agency?: string;
      naics?: string;
      fiscalYear?: number;
      limit?: number;
    }) {
      const filters = buildFilters(args);
      if (args.primeRecipientName) {
        filters.recipient_search_text = [args.primeRecipientName];
      }
      type Resp = {
        results?: {
          "Sub-Award ID"?: string;
          "Sub-Award Recipient"?: string;
          "Sub-Award Amount"?: number;
          "Sub-Award Date"?: string;
          prime_award_generated_internal_id?: string;
        }[];
      };
      const json = await postUsas<Resp>("search/spending_by_award", {
        filters,
        fields: [
          "Sub-Award ID",
          "Sub-Award Recipient",
          "Sub-Award Amount",
          "Sub-Award Date",
          "Sub-Award NAICS",
        ],
        limit: args.limit ?? 15,
        page: 1,
        subawards: true,
      });
      return {
        subawards: (json.results ?? []).map((r) => ({
          subAwardId: r["Sub-Award ID"] ?? "",
          subRecipient: r["Sub-Award Recipient"] ?? "(name redacted)",
          amount: r["Sub-Award Amount"] ?? 0,
          actionDate: r["Sub-Award Date"] ?? "",
          primeAwardId: r.prime_award_generated_internal_id ?? "",
        })),
      };
    }
  • src/server.ts:699-700 (registration)
    Case branch in runTool() switch — dispatches 'usas_search_subawards' to usas.searchSubawards() after parsing args with UsasSubawardsInput.
    case "usas_search_subawards":
      return await usas.searchSubawards(UsasSubawardsInput.parse(args));
  • buildFilters() helper — constructs USAspending API filters from agency, naics, fiscalYear. Used by searchSubawards as the base filter object.
    function buildFilters(args: {
      agency?: string;
      naics?: string;
      fiscalYear?: number;
      setAside?: string;
      pscCodes?: string[];
    }): UsasFilters {
      const filters: UsasFilters = { award_type_codes: ["A", "B", "C", "D"] };
      if (args.agency) {
        filters.agencies = [
          { type: "awarding", tier: "toptier", name: args.agency },
        ];
      }
      if (args.naics) filters.naics_codes = [args.naics];
      if (args.fiscalYear) {
        filters.time_period = [
          {
            start_date: `${args.fiscalYear - 1}-10-01`,
            end_date: `${args.fiscalYear}-09-30`,
          },
        ];
      }
      if (args.setAside) filters.set_aside_type_codes = [args.setAside];
      if (args.pscCodes?.length) filters.psc_codes = args.pscCodes;
      return filters;
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes the tool as enumerating subcontracts (read behavior) but lacks details on pagination, default limits, output format, or authorization requirements. The behavior is implied but not fully disclosed.

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 communicate purpose, context, and output concisely. No filler or redundant information.

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

Completeness2/5

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

Given 5 optional parameters, no output schema, and no annotations, the description is incomplete. It lacks guidance on default behavior when no filters are specified, return structure, or parameter interactions like whether combinations are required.

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

Parameters1/5

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

Schema coverage is 0%, and the description does not mention any of the 5 parameters (primeRecipientName, agency, naics, fiscalYear, limit). The description fails to add meaning beyond the schema, leaving agents without guidance on how to filter or use the optional fields.

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 enumerates subcontracts on prime awards, using specific verbs like 'Enumerate' and 'surfaces the prime/sub network'. It provides concrete use cases ('who teams with Leidos at DISA') that distinguish it from sibling tools that search prime awards or other entity types.

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

Usage Guidelines4/5

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

Two explicit usage examples are given ('who teams with Leidos at DISA' and 'show small-business subs on Accenture's DHS contracts'), clearly indicating when to use this for teaming/network analysis. However, it does not explicitly mention when not to use it or compare to alternatives like usas_search_awards_by_recipient.

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