Skip to main content
Glama

IntoDNS.ai DNS & Email Security Scanner

Generate security headers

generate_security_headers
Read-onlyIdempotent

Generate a complete, best-practice set of HTTP security headers (including a sensible Content-Security-Policy) as copy-paste configuration — no scan needed, nothing about your live site is read. Pick a preset: 'recommended' is a safe baseline that works for most sites, 'strict' is hardened with a nonce-based CSP for higher security, and 'report-only' puts the CSP in report-only mode so you can roll it out and watch for breakage before enforcing it. Advanced users can instead pass a full config object to fine-tune every header; if you pass neither, it defaults to 'recommended'. Returns the resulting headers as name/value pairs, plus ready-to-paste output for nginx, Apache, Caddy, Cloudflare, a Netlify/Cloudflare-Pages _headers file, and raw headers, along with any warnings. Use this to set up headers on a new or unscanned site; use analyze_security_headers first when you want to see what an existing site is already missing.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_security_headers"
  }
}

Input Schema

NameRequiredDescriptionDefault
configNoAdvanced: a full SecurityHeadersConfig object to fine-tune every header. Overrides preset when provided.
presetNoBuilt-in baseline: 'recommended' (safe default), 'strict' (hardened, nonce-based CSP), or 'report-only' (CSP in report-only mode for safe rollout)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Adds real context beyond the annotations: no network read of the live site, the default-to-'recommended' fallback when neither parameter is passed, that warnings may be returned, and that config overrides preset. The only friction is a mild tension with openWorldHint=true, since the description emphasizes that nothing external is touched; that is not a direct contradiction but leaves the boundary slightly ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose and the no-scan constraint, then preset choice, then return shape, then sibling routing — a sensible order. It is delivered as one dense paragraph of roughly 120 words, so the returns and 'use this instead' clauses are harder to scan than they would be as separate lines, but no sentence is filler.

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

Completeness5/5

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

For a two-parameter, annotation-covered generator with no output schema, the description covers inputs (preset vs config, mutual precedence, default), what is returned (name/value pairs, config snippets for nginx/Apache/Caddy/Cloudflare/_headers/raw, plus warnings), and cost/side-effect expectations. An agent has everything needed to call it correctly in one shot.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the enum already lists the three presets, but the description supplies the decision rationale for each (safe baseline, nonce-based hardened CSP, report-only rollout) and clarifies precedence ('Overrides preset when provided') plus the no-argument default. That is meaningful guidance beyond the terse schema descriptions, though it stops short of showing config object structure.

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?

States a specific verb and resource ('Generate a complete, best-practice set of HTTP security headers') and immediately scopes what it does not do ('no scan needed, nothing about your live site is read'). It explicitly separates itself from the sibling analyze_security_headers, so an agent can pick between generating and auditing without opening either schema.

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?

Gives explicit routing: 'Use this to set up headers on a new or unscanned site; use analyze_security_headers first when you want to see what an existing site is already missing.' It also explains which preset applies to which situation (baseline, hardened, safe rollout) and when to prefer config over preset, covering both the when and the alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.