Skip to main content
Glama

zap.include_in_context

Add URL patterns to security testing contexts for automated vulnerability scanning and reconnaissance in bug bounty workflows.

Instructions

Include a URL pattern in a context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNameYesContext name
regexYesURL regex pattern to include

Implementation Reference

  • The MCP tool handler function for 'zap.include_in_context'. It retrieves the ZAP client and calls includeInContext on it, formatting the result.
    async ({ contextName, regex }: any): Promise<ToolResult> => {
      const client = getZAPClient();
      if (!client) {
        return formatToolResult(false, null, 'ZAP client not initialized');
      }
      const result = await client.includeInContext(contextName, regex);
      return formatToolResult(result.success, result.data, result.error);
    }
  • Input schema definition for the 'zap.include_in_context' tool, specifying contextName and regex parameters.
    inputSchema: {
      type: 'object',
      properties: {
        contextName: {
          type: 'string',
          description: 'Context name',
        },
        regex: {
          type: 'string',
          description: 'URL regex pattern to include',
        },
      },
      required: ['contextName', 'regex'],
    },
  • Registration of the 'zap.include_in_context' tool using server.tool, including name, schema, and handler.
      'zap.include_in_context',
      {
        description: 'Include a URL pattern in a context',
        inputSchema: {
          type: 'object',
          properties: {
            contextName: {
              type: 'string',
              description: 'Context name',
            },
            regex: {
              type: 'string',
              description: 'URL regex pattern to include',
            },
          },
          required: ['contextName', 'regex'],
        },
      },
      async ({ contextName, regex }: any): Promise<ToolResult> => {
        const client = getZAPClient();
        if (!client) {
          return formatToolResult(false, null, 'ZAP client not initialized');
        }
        const result = await client.includeInContext(contextName, regex);
        return formatToolResult(result.success, result.data, result.error);
      }
    );
  • ZAPClient helper method that implements the core logic by calling ZAP's REST API endpoint /context/action/includeInContext/ with fallback for contextId.
    async includeInContext(contextName: string, regex: string): Promise<ZAPScanResult> {
      try {
        // First try with contextName, if that fails and we have a numeric contextName, try as contextId
        try {
          const response = await this.client.get('/context/action/includeInContext/', {
            params: { contextName, regex },
          });
          return {
            success: true,
            data: response.data,
          };
        } catch (error: any) {
          // If contextName fails and it's numeric, try as contextId
          if (!isNaN(Number(contextName))) {
            const response = await this.client.get('/context/action/includeInContext/', {
              params: { contextId: contextName, regex },
            });
            return {
              success: true,
              data: response.data,
            };
          }
          throw error;
        }
      } catch (error: any) {
        return {
          success: false,
          error: error.message || 'Failed to include URL in context',
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'include' but doesn't disclose behavioral traits such as whether this is a read or write operation, what permissions are needed, if it's idempotent, or how errors are handled. This is inadequate for a tool with potential mutation effects.

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's appropriately sized and front-loaded, efficiently stating the tool's purpose 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'context' means in this system, the impact of inclusion, or return values. For a tool that likely modifies system state, this leaves significant gaps in understanding.

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 both parameters ('contextName' and 'regex'). The description adds no meaning beyond what the schema provides, such as explaining what constitutes a valid context name or regex pattern. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description states the action ('include') and resource ('URL pattern in a context'), which clarifies the basic purpose. However, it's vague about what 'context' means in this system and doesn't distinguish this tool from sibling tools like 'zap.create_context' or explain how inclusion relates to other ZAP operations.

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 (e.g., whether a context must exist first), exclusions, or relationships to sibling tools like 'zap.create_context' or 'zap.get_urls', leaving the agent with no usage context.

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