Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

sam_lookup_organization

Resolve a SAM.gov federal organization ID to its full parent path name, such as 'VETERANS AFFAIRS, DEPARTMENT OF.VETERANS AFFAIRS, DEPARTMENT OF.245-NETWORK CONTRACT OFFICE 5'. Use when an opportunity returns only an organization ID.

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

  • Zod schema for sam_lookup_organization input — requires a single `organizationId` string field.
    const SamLookupOrgInput = z.object({
      organizationId: z.string().describe("SAM.gov federal-organization id (numeric)"),
    });
  • src/server.ts:311-316 (registration)
    Tool registration entry defining name, description, and inputSchema for sam_lookup_organization.
    {
      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,
    },
  • Handler that resolves a SAM.gov federal-organization id by calling the public SAM.gov API endpoint directly, returning 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,
      };
    }
Behavior3/5

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

No annotations provided, so description carries full burden. It describes the operation as a lookup and gives an example, but does not disclose potential outcomes like null returns, data freshness, or side effects. Adequate for a simple read operation, but could be more explicit.

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, front-loaded with the action and example. No wasted words. Highly efficient.

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 (1 parameter, no output schema), the description covers purpose, use case, and example. Missing explicit return value explanation (e.g., returns a string or null if not found), which would make it complete.

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

Parameters3/5

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

Schema coverage is 100% for the single parameter. The description adds an example and clarifies the parameter is numeric, but does not add significant meaning beyond what the schema already provides.

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 specifies the action: resolve a SAM.gov federal-organization id to its canonical fullParentPathName. Provides a concrete example. Distinguishes from siblings by referencing a specific use case (when sam_get_opportunity returns only an organizationId).

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?

Explicitly states when to use the tool: 'Use when sam_get_opportunity returned only an organizationId.' Provides clear context, but does not discuss when not to use or mention alternatives beyond that condition.

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