Skip to main content
Glama

training.import_portswigger

Import PortSwigger Academy lab solutions into VulneraMCP to enhance security training with structured vulnerability data, payloads, and remediation steps.

Instructions

Import training data from PortSwigger Academy lab solution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labNameYesName of the PortSwigger lab
labUrlNoURL of the lab
vulnerabilityTypeYesType of vulnerability
solutionYesSolution data with payloads and steps

Implementation Reference

  • The main handler function for the 'training.import_portswigger' tool. It processes the provided PortSwigger lab solution, extracts payloads, and saves each one as training data using saveTrainingData.
    async (params: any): Promise<ToolResult> => {
      try {
        const solution = params.solution;
        const payloads = solution.payloads || [];
        const results: any[] = [];
    
        for (const payload of payloads) {
          const id = await saveTrainingData(
            'portswigger',
            params.labName,
            params.vulnerabilityType,
            params.labUrl || '',
            payload.payload || payload,
            solution.successPattern || 'success',
            solution.failurePattern || 'error',
            { solution, labUrl: params.labUrl },
            solution.score || 7
          );
          results.push(id);
        }
    
        return formatToolResult(true, {
          imported: results.length,
          ids: results,
        });
      } catch (error: any) {
        return formatToolResult(false, null, error.message);
      }
  • Input schema defining the expected parameters: labName, labUrl, vulnerabilityType, and solution object.
    type: 'object',
    properties: {
      labName: { type: 'string', description: 'Name of the PortSwigger lab' },
      labUrl: { type: 'string', description: 'URL of the lab' },
      vulnerabilityType: { type: 'string', description: 'Type of vulnerability' },
      solution: { type: 'object', description: 'Solution data with payloads and steps' },
    },
    required: ['labName', 'vulnerabilityType', 'solution'],
  • Registers the tool on the MCP server within the registerTrainingTools function.
    server.tool(
      'training.import_portswigger',
      {
        description: 'Import training data from PortSwigger Academy lab solution',
        inputSchema: {
          type: 'object',
          properties: {
            labName: { type: 'string', description: 'Name of the PortSwigger lab' },
            labUrl: { type: 'string', description: 'URL of the lab' },
            vulnerabilityType: { type: 'string', description: 'Type of vulnerability' },
            solution: { type: 'object', description: 'Solution data with payloads and steps' },
          },
          required: ['labName', 'vulnerabilityType', 'solution'],
        },
      },
      async (params: any): Promise<ToolResult> => {
        try {
          const solution = params.solution;
          const payloads = solution.payloads || [];
          const results: any[] = [];
    
          for (const payload of payloads) {
            const id = await saveTrainingData(
              'portswigger',
              params.labName,
              params.vulnerabilityType,
              params.labUrl || '',
              payload.payload || payload,
              solution.successPattern || 'success',
              solution.failurePattern || 'error',
              { solution, labUrl: params.labUrl },
              solution.score || 7
            );
            results.push(id);
          }
    
          return formatToolResult(true, {
            imported: results.length,
            ids: results,
          });
        } catch (error: any) {
          return formatToolResult(false, null, error.message);
        }
      }
    );
  • src/index.ts:47-47 (registration)
    Calls registerTrainingTools on the main MCP Server instance, which registers all training tools including 'training.import_portswigger'.
    registerTrainingTools(server);
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. While 'Import' implies a write operation, the description doesn't specify whether this creates new records, updates existing ones, requires authentication, has side effects, or what happens on success/failure. For a tool with complex parameters and no annotation coverage, this is a significant gap in transparency.

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 that efficiently communicates the core purpose without unnecessary words. It's front-loaded with the essential information and contains zero waste, making it easy 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 (4 parameters including a nested object, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how errors are handled, or the implications of the import operation. For a tool that likely modifies data, more context about behavior and outcomes is needed.

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 already documents all four parameters with descriptions. The description doesn't add any additional meaning about parameters beyond what's in the schema, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema handles the heavy lifting.

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 ('Import') and resource ('training data from PortSwigger Academy lab solution'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'training.import', 'training.import_htb', or 'training.import_all', which all appear to handle different import sources or methods.

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 prerequisites, when it's appropriate compared to other import tools (e.g., 'training.import' or 'training.import_htb'), or any specific conditions for its use. This leaves the agent without 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

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/telmon95/VulneraMCP'

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