Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

usas_search_awards

Identify top federal contract recipients by agency, NAICS code, and fiscal year using USAspending data. Returns aggregate share-of-wallet with total dollars and award count for competitive landscape analysis.

Instructions

Aggregate share-of-wallet on USAspending. Given an agency × NAICS × fiscal year, returns top recipients by total $ + count. Use for competitive landscape ('who wins at VA in 541512?').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agencyNoCanonical agency name
naicsNo
fiscalYearNo
setAsideNo

Implementation Reference

  • The actual implementation of the searchAwards handler. Calls USAspending 'search/spending_by_category/recipient' endpoint with constructed filters and returns top recipients by total $ + count.
    export async function searchAwards(args: {
      agency?: string;
      naics?: string;
      fiscalYear?: number;
      setAside?: string;
    }) {
      const filters = buildFilters(args);
      type Resp = {
        results?: { name?: string; amount?: number; count?: number }[];
      };
      const json = await postUsas<Resp>(
        "search/spending_by_category/recipient",
        { filters, limit: 10, page: 1 },
      );
      const results = json.results ?? [];
      return {
        totalAwards: results.reduce((s, r) => s + (r.count ?? 0), 0),
        totalValue: results.reduce((s, r) => s + (r.amount ?? 0), 0),
        topRecipients: results.map((r) => ({
          name: r.name ?? "—",
          value: r.amount ?? 0,
          awards: r.count ?? 0,
        })),
      };
    }
  • src/server.ts:318-324 (registration)
    Registration of the 'usas_search_awards' tool: defines name, description, and inputSchema (UsasFiltersBase) in the tool list for MCP discovery.
    // ━━━ USAspending — Awards & Recipients (8) ━━━
    {
      name: "usas_search_awards",
      description:
        "Aggregate share-of-wallet on USAspending. Given an agency × NAICS × fiscal year, returns top recipients by total $ + count. Use for competitive landscape ('who wins at VA in 541512?').",
      inputSchema: UsasFiltersBase,
    },
  • UsasFiltersBase Zod schema: defines optional fields agency, naics, fiscalYear, and setAside used to validate input for usas_search_awards.
    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(),
    });
  • The buildFilters helper function that constructs the USAspending API filter object from args (agency, naics, fiscalYear, setAside, pscCodes).
    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 the burden. It states it aggregates and returns top recipients, but lacks details on ordering, limits, or any side effects. The behavior is adequately but minimally described.

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, no wasted words. The first sentence states the function, the second gives a use case. Perfectly concise.

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

Completeness3/5

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

The description explains the purpose and output (top recipients by total $ and count) but omits details like the setAside parameter, ordering, and default number of results. Given the complexity and no output schema, more detail would be beneficial.

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

Parameters4/5

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

The description covers three of four parameters (agency, naics, fiscalYear) by mentioning them in the use case. The 'setAside' parameter is not mentioned, but the schema has an enum for it. With only 25% schema description coverage, the description adds significant value.

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 aggregates share-of-wallet and returns top recipients by total amount and count, specifying an agency, NAICS, and fiscal year. It distinguishes from sibling tools by focusing on competitive landscape aggregation.

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?

The description explicitly says 'Use for competitive landscape' and provides an example query, giving clear context. However, it does not mention when not to use or list alternative tools.

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