Skip to main content
Glama

get_vulnerabilities

Retrieve all vulnerabilities for a specific penetration testing report to analyze security findings and document assessment results.

Instructions

Retrieve all vulnerabilities for a specific report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bearerTokenNoBearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)
reportIdYesThe ID of the report to get vulnerabilities from (24-character MongoDB ObjectId)

Implementation Reference

  • The handler function that retrieves all vulnerabilities for a specific report ID by making an authenticated GET request to the /vulnerability/report/{reportId} endpoint. Validates reportId format, handles errors, and returns formatted JSON response.
    async function getVulnerabilities(providedToken, reportId) {
      try {
        const bearerToken = getBearerToken(providedToken);
        
        // Validate reportId format (should be MongoDB ObjectId)
        if (!reportId || !reportId.match(/^[0-9a-fA-F]{24}$/)) {
          throw new McpError(
            ErrorCode.InvalidParams,
            'Invalid reportId format. Must be a valid MongoDB ObjectId (24 characters)'
          );
        }
    
        const response = await axios.get(`${VULNERABILITY_ENDPOINT}/report/${reportId}`, {
          headers: {
            'Authorization': `Bearer ${bearerToken}`,
            'Content-Type': 'application/json',
          },
          timeout: 10000,
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                status: response.status,
                data: response.data,
                timestamp: new Date().toISOString(),
                message: `Retrieved vulnerabilities for report ${reportId}`,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        
        if (error.response) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  status: error.response.status,
                  error: error.response.data || error.message,
                  timestamp: new Date().toISOString(),
                }, null, 2),
              },
            ],
          };
        } else if (error.request) {
          throw new McpError(
            ErrorCode.InternalError,
            `Network error: Unable to reach the API at ${VULNERABILITY_ENDPOINT}/report/${reportId}`
          );
        } else {
          throw new McpError(
            ErrorCode.InternalError,
            `Request setup error: ${error.message}`
          );
        }
      }
    }
  • Input schema definition for the get_vulnerabilities tool, specifying parameters bearerToken (optional) and required reportId.
      name: 'get_vulnerabilities',
      description: 'Retrieve all vulnerabilities for a specific report',
      inputSchema: {
        type: 'object',
        properties: {
          bearerToken: {
            type: 'string',
            description: 'Bearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)',
          },
          reportId: {
            type: 'string',
            description: 'The ID of the report to get vulnerabilities from (24-character MongoDB ObjectId)',
          },
        },
        required: ['reportId'],
      },
    },
  • server.js:1145-1152 (registration)
    Tool registration and dispatching in the CallToolRequestHandler switch statement, which validates arguments and calls the getVulnerabilities handler.
    case 'get_vulnerabilities':
      if (!args.reportId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Report ID is required'
        );
      }
      return await getVulnerabilities(args.bearerToken, args.reportId);
  • Helper function used by getVulnerabilities to obtain the bearer token for API authentication, falling back to environment variable if not provided.
    function getBearerToken(providedToken) {
      // If a token is provided in the request, use it
      if (providedToken) {
        return providedToken;
      }
      
      // Otherwise, use the configured JWT token
      if (JWT_TOKEN) {
        return JWT_TOKEN;
      }
      
      // If no token is available, throw an error
      throw new McpError(
        ErrorCode.InvalidParams,
        'No bearer token provided. Either pass bearerToken parameter or set REPORTS_JWT_TOKEN environment variable.'
      );
    }
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 states the tool retrieves vulnerabilities but does not describe output format (e.g., list structure, fields), pagination, error handling, or authentication requirements beyond what's implied in the schema. This is inadequate for a tool that likely returns sensitive 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, clear sentence with zero waste. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration, making it efficient for an agent to parse.

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 retrieving vulnerabilities (likely a list of sensitive data), no annotations, and no output schema, the description is insufficient. It lacks details on return values, error cases, or behavioral traits, leaving significant gaps for an agent to operate 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?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional meaning beyond what the schema provides (e.g., it does not explain the relationship between reportId and vulnerabilities or clarify authentication flow). Baseline 3 is appropriate as the schema handles parameter documentation.

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 action ('Retrieve') and target ('vulnerabilities for a specific report'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'get_vulnerability' (singular) or 'get_all_reports', which might retrieve vulnerabilities indirectly, leaving some ambiguity in scope.

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 does not mention sibling tools like 'get_vulnerability' (for a single vulnerability) or 'get_all_reports' (which might include vulnerabilities), nor does it specify prerequisites or exclusions, leaving the agent to infer usage from context alone.

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/izzy0101010101/mcp-reports-server'

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