Skip to main content
Glama
diplv

companylens-mcp

Government Contracts

company_contracts

Retrieve US government contract data for companies, including awarded contracts from USAspending.gov and open opportunities from SAM.gov, using verified official sources.

Instructions

Get US government contract data for a company: awarded contracts from USAspending.gov and open opportunities from SAM.gov. Use company_search first to get an entity_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYesCompanyLens entity ID from company_search (starts with "companylens_")

Implementation Reference

  • The "company_contracts" tool is registered and implemented in src/index.ts. The implementation includes the schema definition and the async handler that fetches contract data from the API and formats it for the user.
    server.registerTool(
      'company_contracts',
      {
        title: 'Government Contracts',
        description: 'Get US government contract data for a company: awarded contracts from USAspending.gov and open opportunities from SAM.gov. Use company_search first to get an entity_id.',
        inputSchema: z.object({
          entity_id: z.string().describe('CompanyLens entity ID from company_search (starts with "companylens_")'),
        }),
      },
      async ({ entity_id }) => {
        const data = await apiCall(`/v1/company/${entity_id}/contracts`) as {
          name: string;
          awards: Array<{ title: string; agency: string; amount: number; date: string }>;
          opportunities: Array<{ title: string; agency: string; postedDate: string; responseDeadline?: string }>;
          total_award_value: number;
          agent_hint: string;
        };
    
        const parts: string[] = [`${data.name} — Government Contracts\n`];
    
        if (data.awards.length) {
          parts.push(`Total awarded: $${data.total_award_value.toLocaleString()}\n`);
          parts.push('Top awards:');
          data.awards.slice(0, 10).forEach((a) => {
            parts.push(`- $${a.amount.toLocaleString()} from ${a.agency} (${a.date}): ${a.title}`);
          });
        } else {
          parts.push('No awarded contracts found.');
        }
    
        if (data.opportunities.length) {
          parts.push('\nOpen opportunities:');
          data.opportunities.forEach((o) => {
            parts.push(`- ${o.title} (${o.agency}, deadline: ${o.responseDeadline || 'N/A'})`);
          });
        }
    
        parts.push(`\n${data.agent_hint}`);
    
        return { content: [{ type: 'text' as const, text: parts.join('\n') }] };
      },
    );
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses data sources (USAspending.gov, SAM.gov) and data types (awarded contracts, open opportunities) but omits safety declarations (read-only status), error handling, or rate limits.

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 efficiently structured sentences with zero waste: first establishes purpose and data provenance, second states the critical prerequisite. Information is front-loaded with the action verb.

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?

For a single-parameter tool, description adequately covers prerequisites and identifies return data categories (awarded contracts, open opportunities). Absence of output schema limits completeness regarding return structure, but description compensates by naming specific data sources.

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% with complete parameter documentation, establishing baseline. Description references entity_id in workflow context but doesn't add semantic details (format, validation rules) beyond schema's explanation that it starts with 'companylens_'.

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?

Description uses specific verb 'Get' with clear resource 'US government contract data' and distinguishes from siblings (company_court_cases, company_sanctions_check) by specifying the unique domain (USAspending.gov and SAM.gov data).

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?

Provides explicit prerequisite instruction 'Use company_search first to get an entity_id' establishing clear workflow sequence, though it lacks explicit 'when-not-to-use' exclusions or alternative tool recommendations.

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/diplv/companylens-mcp'

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