Skip to main content
Glama

lookup_contract

Retrieve detailed federal contract award information by ID, including modifications, sub-awards, and performance history from USAspending.gov data.

Instructions

Look up a single federal contract award by its ID. Returns full award details including modifications, sub-awards, and performance history. Cost: $0.018 per query. Source: USAspending.gov.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_idYesContract award ID

Implementation Reference

  • The handler function for 'lookup_contract', which fetches contract details from the API based on the provided 'contract_id'.
      async ({ contract_id }) => {
        const res = await apiGet<{ dataset: string; data: Record<string, unknown> }>(
          `/api/v1/contracts/${encodeURIComponent(contract_id)}`,
        );
    
        if (!res.ok) {
          const msg =
            res.status === 404
              ? `Contract ${contract_id} not found.`
              : `API error (${res.status}): ${JSON.stringify(res.data)}`;
          return {
            content: [{ type: "text" as const, text: msg }],
            isError: res.status !== 404,
          };
        }
    
        const warn = stalenessWarning(res);
        return {
          content: [
            { type: "text" as const, text: `${warn}${JSON.stringify(res.data.data, null, 2)}` },
          ],
        };
      },
    );
  • Input schema for 'lookup_contract' tool using Zod for validation.
    inputSchema: {
      contract_id: z
        .string()
        .describe("Contract award ID"),
    },
  • Registration of 'lookup_contract' tool within the MCP server.
    server.registerTool(
      "lookup_contract",

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/carrierone/verilexdata-mcp'

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