Skip to main content
Glama

scan_project

Scan project directories for CVE vulnerabilities by detecting npm, Python, Go, and Rust manifests, querying live OSV.dev data to generate structured vulnerability reports with severity counts and fix recommendations.

Instructions

Scan a project directory for CVE vulnerabilities. Automatically detects npm (package-lock.json), Python (requirements.txt / Pipfile.lock / poetry.lock), Go (go.sum), and Rust (Cargo.lock) manifests. Queries live CVE data from OSV.dev. Returns structured vulnerability report with severity counts, risk score, and fix recommendations. Use this as the first step before open_dashboard or apply_fixes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoAbsolute or relative path to the project directory. Defaults to current working directory.
severity_filterNoOnly return vulnerabilities at this severity or above. Default: all.
offlineNoIf true, skip OSV.dev query and only parse manifests. Default: false.

Implementation Reference

  • The handleScanProject function is the core handler for the scan_project tool. It resolves the directory path, triggers the scanService to perform the actual vulnerability analysis, filters the results based on the provided severity, and formats the output as a Markdown summary.
    async function handleScanProject({ path: dir = '.', severity_filter = 'all', offline = false }) {
      const absDir = resolve(dir);
      if (!existsSync(absDir)) {
        return err(`Directory not found: ${absDir}`);
      }
    
      const result = await scanService(absDir, { noOsv: offline });
      const sevOrder = { critical: 0, high: 1, moderate: 2, low: 3 };
      const filterRank = sevOrder[severity_filter] ?? 4;
    
      const filtered = result.vulns.filter(v => (sevOrder[v.severity] ?? 4) <= filterRank);
    
      // Build a clean, LLM-readable summary
      const lines = [
        `## CVE Scan: ${result.name}`,
        `**Directory:** ${absDir}`,
        `**Ecosystem:** ${result.ecosystem}`,
        `**Packages scanned:** ${result.totalPackages} (${result.directCount} direct)`,
        `**Risk score:** ${result.riskScore}/100`,
        '',
        '### Vulnerability summary',
        `| Severity | Count |`,
        `|----------|-------|`,
        `| 🔴 Critical | ${result.severity.critical} |`,
        `| 🟠 High     | ${result.severity.high} |`,
        `| 🟡 Moderate | ${result.severity.moderate} |`,
        `| 🔵 Low      | ${result.severity.low} |`,
        `| **Total**   | **${result.vulns.length}** |`,
        '',
      ];
    
      if (filtered.length === 0) {
        lines.push(severity_filter === 'all'
          ? '✅ No vulnerabilities found!'
          : `✅ No ${severity_filter}+ vulnerabilities found.`);
      } else {
        lines.push(`### Vulnerabilities (${filtered.length}${severity_filter !== 'all' ? ` filtered to ${severity_filter}+` : ''})`);
        lines.push('');
        for (const v of filtered.slice(0, 30)) {
          const fix = v.fixedIn ? `→ fix: **${v.fixedIn}**` : '→ no fix available';
          const type = v.isDirect ? 'direct' : 'transitive';
          lines.push(`- **[${v.severity.toUpperCase()}]** \`${v.packageName}@${v.packageVersion}\` (${type}) — ${v.title} (${v.cveId || v.id}) ${fix}`);
        }
        if (filtered.length > 30) {
          lines.push(`\n_... and ${filtered.length - 30} more. Use open_dashboard for full list._`);
        }
  • Registration of the scan_project tool, including its schema definition, input parameters, and description.
    {
      name: 'scan_project',
      description:
        'Scan a project directory for CVE vulnerabilities. ' +
        'Automatically detects npm (package-lock.json), Python (requirements.txt / Pipfile.lock / poetry.lock), ' +
        'Go (go.sum), and Rust (Cargo.lock) manifests. ' +
        'Queries live CVE data from OSV.dev. ' +
        'Returns structured vulnerability report with severity counts, risk score, and fix recommendations. ' +
        'Use this as the first step before open_dashboard or apply_fixes.',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Absolute or relative path to the project directory. Defaults to current working directory.',
          },
          severity_filter: {
            type: 'string',
            enum: ['all', 'critical', 'high', 'moderate', 'low'],
            description: 'Only return vulnerabilities at this severity or above. Default: all.',
          },
          offline: {
            type: 'boolean',
            description: 'If true, skip OSV.dev query and only parse manifests. Default: false.',
          },
        },
      },
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it automatically detects specific manifest files, queries live CVE data from OSV.dev, and returns a structured vulnerability report. However, it doesn't mention potential rate limits, authentication needs, or error handling, which would be useful for a tool that queries external APIs.

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 efficiently structured in two sentences: the first explains what the tool does and how it works, and the second provides usage guidance. Every sentence adds value, with no redundant or unnecessary information.

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 tool's complexity (scans multiple languages, queries external API) and lack of annotations and output schema, the description does a good job covering the core functionality and purpose. However, it could be more complete by mentioning the output format in more detail (e.g., what 'structured vulnerability report' includes beyond severity counts and risk score) or error cases.

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?

The schema description coverage is 100%, so the schema already fully documents all three parameters. The description doesn't add any additional meaning or context about the parameters beyond what's in the schema. This meets the baseline of 3 when the schema does the heavy lifting.

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 specific action ('scan a project directory for CVE vulnerabilities'), identifies the target resource ('project directory'), and distinguishes it from siblings by mentioning it's the 'first step before open_dashboard or apply_fixes.' It also lists the specific manifest types it detects (npm, Python, Go, Rust) and the data source (OSV.dev).

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?

The description provides explicit guidance on when to use this tool ('as the first step before open_dashboard or apply_fixes'), which clearly positions it relative to the sibling tools. It also implies when not to use it (e.g., if you already have scan results and want to apply fixes, use apply_fixes instead).

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/toan203/osv-ui'

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