Skip to main content
Glama

zap.start_spider

Initiate a crawler scan on a target URL to map web application structure and identify accessible pages for security assessment.

Instructions

Start a spider (crawler) scan on a target URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL to spider
maxChildrenNoMaximum number of children to crawl (optional)
recurseNoWhether to recurse into subdirectories (optional)
contextNameNoContext name to use (optional)

Implementation Reference

  • MCP tool handler for 'zap.start_spider': initializes ZAP client, starts spider scan via client.startSpider(), saves test result if successful, and formats the tool result.
    async ({ url, maxChildren, recurse, contextName }: any): Promise<ToolResult> => {
      const client = getZAPClient();
      if (!client) {
        return formatToolResult(false, null, 'ZAP client not initialized');
      }
      const result = await client.startSpider(url, maxChildren, recurse, contextName);
      if (result.success) {
        await safeSaveTestResult(url, 'zap_spider', true, result.data);
      }
      return formatToolResult(result.success, result.data, result.error);
    }
  • Input schema for 'zap.start_spider' tool: requires 'url', optional 'maxChildren', 'recurse', 'contextName'.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'Target URL to spider',
        },
        maxChildren: {
          type: 'number',
          description: 'Maximum number of children to crawl (optional)',
        },
        recurse: {
          type: 'boolean',
          description: 'Whether to recurse into subdirectories (optional)',
        },
        contextName: {
          type: 'string',
          description: 'Context name to use (optional)',
        },
      },
      required: ['url'],
    },
  • src/tools/zap.ts:59-97 (registration)
    Registers the 'zap.start_spider' tool on the MCP server within registerZAPTools function.
    server.tool(
      'zap.start_spider',
      {
        description: 'Start a spider (crawler) scan on a target URL',
        inputSchema: {
          type: 'object',
          properties: {
            url: {
              type: 'string',
              description: 'Target URL to spider',
            },
            maxChildren: {
              type: 'number',
              description: 'Maximum number of children to crawl (optional)',
            },
            recurse: {
              type: 'boolean',
              description: 'Whether to recurse into subdirectories (optional)',
            },
            contextName: {
              type: 'string',
              description: 'Context name to use (optional)',
            },
          },
          required: ['url'],
        },
      },
      async ({ url, maxChildren, recurse, contextName }: any): Promise<ToolResult> => {
        const client = getZAPClient();
        if (!client) {
          return formatToolResult(false, null, 'ZAP client not initialized');
        }
        const result = await client.startSpider(url, maxChildren, recurse, contextName);
        if (result.success) {
          await safeSaveTestResult(url, 'zap_spider', true, result.data);
        }
        return formatToolResult(result.success, result.data, result.error);
      }
    );
  • ZAPClient.startSpider method: core implementation that calls ZAP REST API /spider/action/scan/ to start the spider scan and returns scan ID.
    async startSpider(url: string, maxChildren?: number, recurse?: boolean, contextName?: string): Promise<ZAPScanResult> {
      try {
        const params: any = { url };
        if (maxChildren) params.maxChildren = maxChildren;
        if (recurse !== undefined) params.recurse = recurse;
        if (contextName) params.contextName = contextName;
    
        const response = await this.client.get('/spider/action/scan/', { params });
        
        // Handle different response formats
        const scanId = response.data.scan || response.data.scanId || response.data;
        if (!scanId && scanId !== 0) {
          throw new Error('No scan ID returned from ZAP');
        }
        
        return {
          success: true,
          data: {
            scanId: scanId.toString(),
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message || 'Failed to start spider scan',
        };
      }
    }
  • src/index.ts:49-49 (registration)
    Top-level call to registerZAPTools(server) which includes registration of 'zap.start_spider'.
    registerZAPTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions starting a scan but doesn't describe what the spider does (e.g., crawling web pages, discovering links), potential side effects (e.g., generating traffic, consuming resources), authentication needs, rate limits, or what happens after starting (e.g., asynchronous operation, how to check status). The description is minimal and lacks crucial operational context.

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 gets straight to the point with zero wasted words. It's appropriately sized for a tool with a clear primary function and doesn't bury key information. The structure is front-loaded with the core action and target.

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?

For a tool that initiates a potentially resource-intensive scanning operation with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., scan ID, status), how to monitor progress, error conditions, or behavioral implications. The context signals indicate complexity (4 parameters, no output schema) that warrants more comprehensive description than provided.

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 all parameters are documented in the schema. The description adds no additional parameter semantics beyond implying the 'url' parameter is required. It doesn't explain relationships between parameters (e.g., how 'maxChildren' and 'recurse' interact) or provide usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Start a spider (crawler) scan') and the target resource ('on a target URL'), using precise technical terminology. It distinguishes this tool from other spider-related tools like 'zap.get_spider_status' by focusing on initiating the scan rather than checking its status.

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 related tools like 'zap.start_active_scan' for different scanning approaches, nor does it specify prerequisites (e.g., whether the target must be accessible or if ZAP must be running). Usage context is implied but not explicitly stated.

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