Skip to main content
Glama
Seiya-wasabi

mcp-server-security-snapshot

scan_security_headers

Audit website security headers to identify vulnerabilities in HSTS, CSP, X-Frame-Options, and other HTTP protections before recommending improvements.

Instructions

Scan a public URL and return its HTTP security header status. Checks: HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, HTTPS enforcement, redirect chain, security.txt, robots.txt, sitemap.xml. Costs 0.05 USDC per call (paid automatically from the configured wallet). Use this to audit a website's security hygiene before recommending improvements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe public URL to scan (e.g. https://example.com)

Implementation Reference

  • The logic for `scan_security_headers` tool execution. It validates inputs, performs a payment-enabled fetch (using `fetch402`), and returns the scan result.
    if (name === "scan_security_headers") {
      const parsed = ScanInputSchema.safeParse(args);
      if (!parsed.success) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid input: ${parsed.error.errors.map((e) => e.message).join(", ")}`
        );
      }
    
      const { url } = parsed.data;
    
      let res: Response;
      try {
        res = await fetch402(`${BASE_URL}/v1/snapshot`, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ url }),
        });
      } catch (err) {
        throw new McpError(
          ErrorCode.InternalError,
          `Request failed: ${err instanceof Error ? err.message : String(err)}`
        );
      }
    
      if (res.status === 400) {
        const errBody = await res.json();
        return {
          content: [
            {
              type: "text",
              text: `Error scanning ${url}: ${errBody.error} (${errBody.error_type})`,
            },
          ],
          isError: true,
        };
      }
    
      if (!res.ok) {
        throw new McpError(ErrorCode.InternalError, `API returned unexpected status ${res.status}`);
      }
    
      const data = await res.json();
      return {
        content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
      };
    }
  • The Zod validation schema `ScanInputSchema` for the `scan_security_headers` tool input.
    const ScanInputSchema = z.object({
      url: z.string().url("Must be a valid URL (e.g. https://example.com)"),
    });
  • src/index.ts:63-81 (registration)
    Definition and registration of the `scan_security_headers` tool in the `ListToolsRequestSchema` handler.
    {
      name: "scan_security_headers",
      description:
        "Scan a public URL and return its HTTP security header status. " +
        "Checks: HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, " +
        "Permissions-Policy, HTTPS enforcement, redirect chain, security.txt, robots.txt, sitemap.xml. " +
        "Costs 0.05 USDC per call (paid automatically from the configured wallet). " +
        "Use this to audit a website's security hygiene before recommending improvements.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "The public URL to scan (e.g. https://example.com)",
          },
        },
        required: ["url"],
      },
    },
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: the tool scans public URLs, lists specific security checks performed, and importantly reveals the cost ('Costs 0.05 USDC per call') and payment mechanism ('paid automatically from the configured wallet'). It doesn't mention rate limits, error handling, or response format details.

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 efficiently structured in two sentences: the first explains what the tool does and lists checks, the second provides usage context and cost information. Every element serves a clear purpose with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no annotations and no output schema, the description provides good context: purpose, specific checks, cost information, and usage guidance. It could be more complete by describing the return format or what 'status' means, but given the tool's relative simplicity, it's mostly adequate.

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?

The schema description coverage is 100% with the single 'url' parameter well-documented in the schema. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline for high schema coverage without adding extra value.

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 tool's purpose with specific verbs ('scan', 'return') and resources ('public URL', 'HTTP security header status'), and lists 11 specific checks performed. It distinguishes from the sibling tool 'demo_security_snapshot' by specifying this is for auditing security hygiene before improvements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('to audit a website's security hygiene before recommending improvements'), which clearly differentiates it from the sibling tool 'demo_security_snapshot' (implied to be a different type of security assessment).

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/Seiya-wasabi/mcp-server-security-snapshot'

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