Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

usas_search_subagency_spending

Break down a parent agency's spending by sub-agency or office to identify which office holds the budget.

Instructions

Break down a parent agency's spending by sub-agency / office. Surfaces which office holds the budget (e.g. VA OI&T vs VHA, DoD vs Army vs DISA).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agencyYes
fiscalYearNo

Implementation Reference

  • The main handler function for the tool. Calls the USAspending API endpoint 'search/spending_by_category/awarding_subagency' with a filter by agency (and optional fiscalYear), and returns a list of sub-agencies with name, amount, and award count.
    export async function searchSubAgencySpending(args: {
      agency: string;
      fiscalYear?: number;
    }) {
      const filters = buildFilters(args);
      type Resp = {
        results?: { name?: string; amount?: number; count?: number }[];
      };
      const json = await postUsas<Resp>(
        "search/spending_by_category/awarding_subagency",
        { filters, limit: 10, page: 1 },
      );
      return {
        subAgencies: (json.results ?? []).map((r) => ({
          name: r.name ?? "",
          amount: r.amount ?? 0,
          awards: r.count ?? 0,
        })),
      };
    }
  • Zod input schema for the tool: requires 'agency' (string) and optional 'fiscalYear' (integer >= 2007).
    const UsasSubAgencyInput = z.object({
      agency: z.string(),
      fiscalYear: z.number().int().min(2007).optional(),
    });
  • src/server.ts:331-336 (registration)
    Registration of the tool in the server's tool list, linking the name 'usas_search_subagency_spending' to its description and input schema.
    {
      name: "usas_search_subagency_spending",
      description:
        "Break down a parent agency's spending by sub-agency / office. Surfaces which office holds the budget (e.g. VA OI&T vs VHA, DoD vs Army vs DISA).",
      inputSchema: UsasSubAgencyInput,
    },
  • src/server.ts:689-690 (registration)
    Case branch in the server's tool dispatch that parses args with UsasSubAgencyInput and calls usas.searchSubAgencySpending().
    case "usas_search_subagency_spending":
      return await usas.searchSubAgencySpending(UsasSubAgencyInput.parse(args));
  • Helper function buildFilters() that constructs the USAspending API filter object (agency, fiscalYear as time_period, etc.) used by the handler.
    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 must fully disclose behavior. It states it surfaces which office holds the budget with examples, but lacks details on limitations, data availability, or error handling, which is a gap for a tool with no annotations.

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, front-loads the key action, and uses examples efficiently. No wasted words.

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?

Given the tool has two parameters, no output schema, and no annotations, the description covers the core function and provides examples. However, it lacks parameter details and behavioral notes, leaving some gaps for an agent to fully understand usage.

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 0%, yet the description does not explain the 'agency' or 'fiscalYear' parameters. It mentions 'parent agency' informally but fails to clarify that 'agency' is the input and 'fiscalYear' is optional. The description adds minimal value beyond the schema.

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 verb 'break down' and resource 'parent agency spending by sub-agency/office', with concrete examples (VA OI&T vs VHA) that differentiate it from sibling tools like usas_search_agency_spending.

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 implies usage for sub-agency breakdown, and the context of sibling tools provides alternatives. It does not explicitly state when not to use, but the purpose is clear enough.

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