Skip to main content
Glama

training.extract_from_writeup

Extract training patterns from bug bounty writeups to identify vulnerability types and improve security testing methodologies.

Instructions

Extract training patterns from bug bounty writeup text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
writeupTextYesBug bounty writeup text
vulnerabilityTypeYesType of vulnerability
sourceNoSource of writeupcustom

Implementation Reference

  • The main execution logic for the 'training.extract_from_writeup' tool. Parses writeup text to extract target patterns, payloads, success/failure indicators, calculates severity score, saves to database via saveTrainingData, and returns formatted result.
    async (params: any): Promise<ToolResult> => {
      try {
        const text = params.writeupText.toLowerCase();
        const vulnType = params.vulnerabilityType;
    
        // Extract URLs/endpoints
        const urlPattern = /https?:\/\/[^\s"<>]+/gi;
        const urls = text.match(urlPattern) || [];
        const targetPattern = urls[0]?.split('?')[0] || '';
    
        // Extract payloads
        const payloadPatterns = [
          /payload[:\s]+([^\n]+)/gi,
          /exploit[:\s]+([^\n]+)/gi,
          /<script[^>]*>([^<]+)<\/script>/gi,
          /'[^']*'/g,
          /"[^"]*"/g,
        ];
    
        let payloadPattern = '';
        for (const pattern of payloadPatterns) {
          const matches = text.match(pattern);
          if (matches && matches.length > 0) {
            payloadPattern = matches[0].substring(0, 100);
            break;
          }
        }
    
        // Extract success indicators
        const successPatterns = [
          /success|vulnerable|exploited|confirmed|poc|proof of concept/gi,
          /alert\(|xss|injection|bypass/gi,
        ];
        let successPattern = 'success|vulnerable|exploited';
        for (const pattern of successPatterns) {
          if (pattern.test(text)) {
            successPattern = pattern.source.replace(/[\\^$.*+?()[\]{}|]/g, '');
            break;
          }
        }
    
        // Extract failure indicators
        const failurePattern = 'error|blocked|filtered|sanitized';
    
        // Calculate score based on keywords
        let score = 5;
        if (text.includes('critical') || text.includes('rce') || text.includes('takeover')) {
          score = 10;
        } else if (text.includes('high') || text.includes('sql injection') || text.includes('auth bypass')) {
          score = 9;
        } else if (text.includes('xss') || text.includes('csrf')) {
          score = 7;
        }
    
        const id = await saveTrainingData(
          params.source || 'custom',
          `writeup-${Date.now()}`,
          vulnType,
          targetPattern,
          payloadPattern,
          successPattern,
          failurePattern,
          { extractedFrom: 'writeup', originalText: params.writeupText.substring(0, 500) },
          score
        );
    
        return formatToolResult(true, {
          id,
          extracted: {
            targetPattern,
            payloadPattern,
            successPattern,
            failurePattern,
            score,
          },
        });
      } catch (error: any) {
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema defining parameters for the tool: writeupText (required string), vulnerabilityType (required string), source (optional string).
    inputSchema: {
      type: 'object',
      properties: {
        writeupText: { type: 'string', description: 'Bug bounty writeup text' },
        vulnerabilityType: { type: 'string', description: 'Type of vulnerability' },
        source: { type: 'string', description: 'Source of writeup', default: 'custom' },
      },
      required: ['writeupText', 'vulnerabilityType'],
    },
  • Direct registration of the 'training.extract_from_writeup' tool on the MCP server, specifying name, description, input schema, and handler reference.
    server.tool(
      'training.extract_from_writeup',
      {
        description: 'Extract training patterns from bug bounty writeup text',
        inputSchema: {
          type: 'object',
          properties: {
            writeupText: { type: 'string', description: 'Bug bounty writeup text' },
            vulnerabilityType: { type: 'string', description: 'Type of vulnerability' },
            source: { type: 'string', description: 'Source of writeup', default: 'custom' },
          },
          required: ['writeupText', 'vulnerabilityType'],
        },
      },
  • src/index.ts:48-48 (registration)
    Top-level invocation of registerTrainingExtractorTools on the main server instance, which registers the 'training.extract_from_writeup' tool among other training extractor tools.
    registerTrainingExtractorTools(server);
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 ('Extract') but lacks details on what 'training patterns' entail, how extraction is performed, potential limitations, or output format. This leaves significant gaps in understanding the tool's behavior beyond the basic operation.

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 no wasted words. It's front-loaded with the core action and resource, making it easy to grasp quickly without unnecessary elaboration.

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 extracting patterns from text, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'training patterns' are, how they're formatted, or any behavioral traits, leaving the agent with insufficient context for effective 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 schema already documents all parameters. The description doesn't add any meaning beyond the schema, such as explaining the relationship between parameters or providing examples. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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 ('Extract training patterns') and the resource ('from bug bounty writeup text'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'training.match' or 'training.get_csrf_patterns', which might have overlapping or related functionality, so it doesn't reach the highest 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. It doesn't mention prerequisites, context, or exclusions, such as whether it's for initial analysis or post-processing, or how it differs from other training tools like 'training.import' or 'training.match'.

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