Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

sam_lookup_organization

Resolve a SAM.gov federal organization ID to its full hierarchy path name, providing complete organizational context when only an ID is available.

Instructions

Resolve a SAM.gov federal-organization id to its canonical fullParentPathName (e.g. 'VETERANS AFFAIRS, DEPARTMENT OF.VETERANS AFFAIRS, DEPARTMENT OF.245-NETWORK CONTRACT OFFICE 5'). Use when sam_get_opportunity returned only an organizationId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesSAM.gov federal-organization id (numeric)

Implementation Reference

  • The actual handler logic for the sam_lookup_organization tool. It parses the organizationId from the input, makes a direct fetch to sam.gov's public federal organizations API endpoint, and returns the organization's fullParentPathName, agencyName, name, type, and level.
    case "sam_lookup_organization": {
      const { organizationId } = SamLookupOrgInput.parse(args);
      // SamGovClient internal method — exposed via direct fetch since
      // it's not on the public surface. Use the public sam.gov endpoint
      // directly (already keyless).
      const r = await fetch(
        `https://sam.gov/api/prod/federalorganizations/v1/organizations/${encodeURIComponent(organizationId)}`,
        {
          headers: { Accept: "application/hal+json" },
          signal: AbortSignal.timeout(10_000),
        },
      );
      if (!r.ok) {
        return { found: false, organizationId, status: r.status };
      }
      type Resp = {
        _embedded?: {
          org?: {
            fullParentPathName?: string;
            agencyName?: string;
            name?: string;
            type?: string;
            level?: number;
          };
        }[];
      };
      const json = (await r.json()) as Resp;
      const org = json._embedded?.[0]?.org;
      return {
        found: !!org,
        organizationId,
        fullParentPathName: org?.fullParentPathName ?? "",
        agencyName: org?.agencyName ?? "",
        name: org?.name ?? "",
        type: org?.type,
        level: org?.level,
      };
    }
  • The Zod input schema (SamLookupOrgInput) for the sam_lookup_organization tool, requiring a single string field 'organizationId' described as 'SAM.gov federal-organization id (numeric)'.
    const SamLookupOrgInput = z.object({
      organizationId: z.string().describe("SAM.gov federal-organization id (numeric)"),
    });
  • src/server.ts:313-317 (registration)
    The tool registration entry in the TOOLS array, defining the name 'sam_lookup_organization', its description, and linking to SamLookupOrgInput as the inputSchema.
      name: "sam_lookup_organization",
      description:
        "Resolve a SAM.gov federal-organization id to its canonical fullParentPathName (e.g. 'VETERANS AFFAIRS, DEPARTMENT OF.VETERANS AFFAIRS, DEPARTMENT OF.245-NETWORK CONTRACT OFFICE 5'). Use when sam_get_opportunity returned only an organizationId.",
      inputSchema: SamLookupOrgInput,
    },
Behavior3/5

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

No annotations provided, so description must cover behavior. It describes what it does but does not state that it is a read-only lookup, mention permissions, rate limits, or error scenarios. Could be improved by clarifying it's a safe query.

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 short sentences, front-loaded with action. Every word adds value.

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 the simplicity (one param, no output schema), description is adequate. Includes example output and usage trigger. Minor missing details like format validation or error handling, but not critical.

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?

Schema covers the parameter with description, but the tool description adds value by explaining the output and usage context. The single parameter is well-defined.

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?

Clearly states it resolves SAM.gov federal-organization id to canonical fullParentPathName, with an example. Distinguishes from sibling sam_get_opportunity by specifying when to use it.

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?

Explicitly tells when to use this tool: when sam_get_opportunity returned only an organizationId. This provides a clear condition, helping the agent decide.

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