Skip to main content
Glama
Cyreslab-AI

Nessus MCP Server

search_vulnerabilities

Scan and identify vulnerabilities by keyword across systems using the Nessus MCP Server, enabling targeted security assessments and threat mitigation.

Instructions

Search for vulnerabilities by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesKeyword to search for in vulnerability names and descriptions

Implementation Reference

  • The main handler function implementing the search_vulnerabilities tool. Validates keyword input, searches through mock vulnerabilities data by name or description, formats and returns matching results or error messages.
    export const searchVulnerabilitiesToolHandler = async (args: Record<string, unknown>) => {
      try {
        // Validate arguments
        if (!args.keyword || typeof args.keyword !== 'string') {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: Keyword is required and must be a string'
              }
            ],
            isError: true
          };
        }
    
        const keyword = args.keyword.toLowerCase();
    
        // Import vulnerabilities from mock-data
        const { vulnerabilities } = await import('../mock-data.js');
    
        // Search for vulnerabilities matching the keyword
        const matches = vulnerabilities.filter(vuln =>
          vuln.name.toLowerCase().includes(keyword) ||
          vuln.description.toLowerCase().includes(keyword)
        );
    
        if (matches.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: `No vulnerabilities found matching "${args.keyword}"`
              }
            ]
          };
        }
    
        // Format the search results
        let results = `# Vulnerability Search Results for "${args.keyword}"\n\n`;
        results += `Found ${matches.length} matching vulnerabilities:\n\n`;
    
        matches.forEach((vuln, index) => {
          results += `## ${index + 1}. ${vuln.name} (${vuln.id})\n\n`;
          results += `**Severity:** ${vuln.severity.toUpperCase()}\n`;
          results += `**CVSS Score:** ${vuln.cvss_score}\n\n`;
          results += `${vuln.description}\n\n`;
          results += `To get full details, use the \`get_vulnerability_details\` tool with vulnerability_id: ${vuln.id}\n\n`;
        });
    
        return {
          content: [
            {
              type: 'text',
              text: results
            }
          ]
        };
      } catch (error) {
        const mcpError = handleNessusApiError(error);
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${mcpError.message}`
            }
          ],
          isError: true
        };
      }
    };
  • Defines the input schema for the search_vulnerabilities tool, specifying a required 'keyword' string parameter.
    export const searchVulnerabilitiesToolSchema = {
      name: 'search_vulnerabilities',
      description: 'Search for vulnerabilities by keyword',
      inputSchema: {
        type: 'object',
        properties: {
          keyword: {
            type: 'string',
            description: 'Keyword to search for in vulnerability names and descriptions'
          }
        },
        required: ['keyword']
      }
    };
  • src/index.ts:71-86 (registration)
    Registers the search_vulnerabilities tool schema in the ListToolsRequest handler, making it discoverable.
    server.setRequestHandler(
      ListToolsRequestSchema,
      async () => {
        return {
          tools: [
            listScanTemplatesToolSchema,
            startScanToolSchema,
            getScanStatusToolSchema,
            getScanResultsToolSchema,
            listScansToolSchema,
            getVulnerabilityDetailsToolSchema,
            searchVulnerabilitiesToolSchema
          ]
        };
      }
    );
  • src/index.ts:109-110 (registration)
    Dispatches calls to the 'search_vulnerabilities' tool by invoking its handler in the CallToolRequest switch statement.
    case 'search_vulnerabilities':
      return await searchVulnerabilitiesToolHandler(args);
  • src/index.ts:33-37 (registration)
    Imports the schema and handler for search_vulnerabilities from vulnerabilities.ts for use in the main server.
      getVulnerabilityDetailsToolSchema,
      getVulnerabilityDetailsToolHandler,
      searchVulnerabilitiesToolSchema,
      searchVulnerabilitiesToolHandler
    } from './tools/vulnerabilities.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches vulnerabilities but doesn't describe behavioral traits such as whether it's read-only (implied by 'search'), potential rate limits, authentication needs, or what the search returns (e.g., list of matches, error handling). The description is minimal and lacks critical context for safe and effective use.

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 extremely concise with a single sentence: 'Search for vulnerabilities by keyword'. It is front-loaded and wastes no words, making it easy to parse. Every part of the sentence contributes directly to the tool's purpose, earning its place efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a search operation with no output schema) and lack of annotations, the description is incomplete. It doesn't explain what the search returns, how results are formatted, or any limitations (e.g., partial matches, case sensitivity). For a tool that likely returns a list of vulnerabilities, more context is needed to guide the agent effectively.

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 input schema has 100% description coverage, with the 'keyword' parameter fully documented in the schema. The description adds no additional meaning beyond what the schema provides—it mentions 'keyword' but doesn't elaborate on syntax, examples, or search behavior. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as 'Search for vulnerabilities by keyword', which is clear but vague. It specifies the action (search) and resource (vulnerabilities) but lacks specificity about scope or differentiation from siblings like 'get_vulnerability_details' or 'list_scans'. It doesn't mention what aspects of vulnerabilities are searched (e.g., names, descriptions as implied by schema).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_vulnerability_details' for specific vulnerability info or 'list_scans' for broader scan results, nor does it specify contexts like preliminary investigation versus detailed analysis. Usage is implied only by the action 'search', with no exclusions or prerequisites stated.

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

Related 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/Cyreslab-AI/nessus-mcp-server'

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