Skip to main content
Glama
Cyreslab-AI

Nessus MCP Server

get_scan_results

Retrieve detailed results of a completed scan by specifying its unique ID, enabling efficient analysis and reporting of vulnerabilities.

Instructions

Get the results of a completed scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_idYesID of the scan to get results for

Implementation Reference

  • The primary handler for the 'get_scan_results' tool. Validates the scan_id argument, fetches results via getScanResults helper, handles errors, formats output using formatScanResults, and returns MCP-formatted content.
    export const getScanResultsToolHandler = async (args: Record<string, unknown>) => {
      try {
        // Validate arguments
        const scanId = validateScanId(args.scan_id);
    
        // Get scan results
        const results = await getScanResults(scanId);
    
        // Check if there was an error
        if ('error' in results) {
          return {
            content: [
              {
                type: 'text',
                text: `Error: ${results.error}`
              }
            ],
            isError: true
          };
        }
    
        // Format the results
        const formattedResults = formatScanResults(results);
    
        return {
          content: [
            {
              type: 'text',
              text: formattedResults
            }
          ]
        };
      } catch (error) {
        const mcpError = handleNessusApiError(error);
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${mcpError.message}`
            }
          ],
          isError: true
        };
      }
    };
  • The input schema definition for the 'get_scan_results' tool, specifying the required scan_id parameter.
    export const getScanResultsToolSchema = {
      name: 'get_scan_results',
      description: 'Get the results of a completed scan',
      inputSchema: {
        type: 'object',
        properties: {
          scan_id: {
            type: 'string',
            description: 'ID of the scan to get results for'
          }
        },
        required: ['scan_id']
      }
    };
  • src/index.ts:103-104 (registration)
    Tool dispatch registration in the main CallToolRequestSchema handler switch statement.
    case 'get_scan_results':
      return await getScanResultsToolHandler(args);
  • src/index.ts:75-84 (registration)
    Tool schema registration in the ListToolsRequestSchema handler, where getScanResultsToolSchema is listed among available tools.
      tools: [
        listScanTemplatesToolSchema,
        startScanToolSchema,
        getScanStatusToolSchema,
        getScanResultsToolSchema,
        listScansToolSchema,
        getVulnerabilityDetailsToolSchema,
        searchVulnerabilitiesToolSchema
      ]
    };
  • Core helper function called by the tool handler to retrieve scan results from Nessus API (mock or real).
    export const getScanResults = async (scanId: string) => {
      if (config.useMock) {
        return getMockScanResults(scanId);
      }
    
      // Real API implementation would go here
      throw new Error("Real API not implemented");
    };
Behavior2/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 only states that it retrieves results for completed scans, lacking details on permissions, rate limits, error handling, or response format. This is inadequate for a tool that likely returns complex data.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 complexity of scan results (likely involving vulnerabilities or security data), no annotations, and no output schema, the description is insufficient. It doesn't explain what 'results' include, how they're structured, or any prerequisites, leaving significant gaps for an agent to use the tool 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, clearly documenting the 'scan_id' parameter. The description doesn't add any additional meaning beyond what the schema provides, such as format examples or constraints, so it meets the baseline score of 3.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('results of a completed scan'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_scan_status' or 'list_scans', which could cause confusion about when to use each tool.

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 minimal guidance by specifying 'completed scan', which implies it shouldn't be used for ongoing scans. However, it doesn't mention alternatives like 'get_scan_status' for status checks or 'list_scans' for scanning available scans, leaving the agent with little context for tool selection.

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