Skip to main content
Glama

delete_vulnerability

Remove vulnerabilities from penetration testing reports by specifying their unique ID to maintain accurate security assessment documentation.

Instructions

Delete a vulnerability by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bearerTokenNoBearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)
vulnerabilityIdYesThe ID of the vulnerability to delete (24-character MongoDB ObjectId)

Implementation Reference

  • The handler function deleteVulnerability that executes the tool logic: validates input, makes DELETE API call to delete the vulnerability, handles responses and errors appropriately.
    async function deleteVulnerability(providedToken, vulnerabilityId) {
      try {
        const bearerToken = getBearerToken(providedToken);
        
        // Validate vulnerabilityId format (should be MongoDB ObjectId)
        if (!vulnerabilityId || !vulnerabilityId.match(/^[0-9a-fA-F]{24}$/)) {
          throw new McpError(
            ErrorCode.InvalidParams,
            'Invalid vulnerabilityId format. Must be a valid MongoDB ObjectId (24 characters)'
          );
        }
    
        const response = await axios.delete(`${VULNERABILITY_ENDPOINT}/${vulnerabilityId}`, {
          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: `Successfully deleted vulnerability ${vulnerabilityId}`,
              }, 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}/${vulnerabilityId}`
          );
        } else {
          throw new McpError(
            ErrorCode.InternalError,
            `Request setup error: ${error.message}`
          );
        }
      }
    }
  • The input schema definition for the 'delete_vulnerability' tool, specifying parameters bearerToken (optional) and vulnerabilityId (required).
    inputSchema: {
      type: 'object',
      properties: {
        bearerToken: {
          type: 'string',
          description: 'Bearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)',
        },
        vulnerabilityId: {
          type: 'string',
          description: 'The ID of the vulnerability to delete (24-character MongoDB ObjectId)',
        },
      },
      required: ['vulnerabilityId'],
  • server.js:1192-1200 (registration)
    The registration/dispatch case in the CallToolRequestSchema handler's switch statement that calls the deleteVulnerability handler.
    case 'delete_vulnerability':
      if (!args.vulnerabilityId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Vulnerability ID is required'
        );
      }
      return await deleteVulnerability(args.bearerToken, args.vulnerabilityId);
  • server.js:973-989 (registration)
    The tool definition in the tools list returned by ListToolsRequestSchema, including name, description, and schema.
    {
      name: 'delete_vulnerability',
      description: 'Delete a vulnerability by ID',
      inputSchema: {
        type: 'object',
        properties: {
          bearerToken: {
            type: 'string',
            description: 'Bearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)',
          },
          vulnerabilityId: {
            type: 'string',
            description: 'The ID of the vulnerability to delete (24-character MongoDB ObjectId)',
          },
        },
        required: ['vulnerabilityId'],
      },
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 action is 'Delete,' implying a destructive mutation, but fails to specify if deletion is permanent, reversible, requires specific permissions, or has side effects (e.g., cascading deletions). This is a significant gap for a destructive tool with zero annotation coverage.

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 with zero waste—'Delete a vulnerability by ID'—front-loading the core action and resource. Every word earns its place, making it highly concise and well-structured for quick comprehension.

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 destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address critical context like what 'delete' means operationally, potential errors, or return values. For a mutation tool with high complexity implications, this minimal description leaves too many gaps for effective agent use.

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 input schema fully documents both parameters (bearerToken and vulnerabilityId). The description adds no additional parameter semantics beyond implying 'vulnerabilityId' is used for deletion. Since the schema handles the heavy lifting, the baseline score of 3 is appropriate, with no extra value from the description.

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 ('Delete') and resource ('a vulnerability by ID'), making the purpose immediately understandable. It distinguishes from siblings like 'get_vulnerability' or 'update_vulnerability' by specifying deletion. However, it doesn't explicitly mention what 'delete' entails (e.g., permanent removal vs soft delete), which prevents a perfect score.

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 like 'update_vulnerability' or other siblings. It lacks context about prerequisites (e.g., needing an existing vulnerability ID) or exclusions (e.g., not for creating vulnerabilities). This minimal guidance leaves the agent to infer usage from the name 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