Skip to main content
Glama

generate_security_headers

Read-onlyIdempotent

Generate best-practice HTTP security headers with configurable presets (recommended, strict, report-only) and output for nginx, Apache, Caddy, Cloudflare, and more. No scan needed; perfect for new or unscanned sites.

Instructions

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.

Input Schema

TableJSON 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)
Behavior5/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=true, and destructiveHint=false, and the description reinforces this with "no scan needed, nothing about your live site is read." It further discloses behavioral details: returns headers as name/value pairs, ready-to-paste output for multiple server formats, and warnings, plus default behavior when neither preset nor config is supplied.

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 information-dense but well-structured: it opens with the core purpose, then explains presets, advanced config, return format, and finally the sibling-tool alternative. Every sentence contributes essential guidance, with no filler or repetition of schema details.

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?

Given two optional parameters, one nested config object, no output schema, and strong annotations, the description covers all essential context: preset options, advanced config usage, default behavior, output formats, warnings, and when to use the sibling analysis tool. It is complete enough for an agent to select and invoke the tool correctly.

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 description coverage is 100%, but the description adds meaningful context beyond the schema: it explains the practical effect of each preset, notes that config overrides preset, and states the default when neither is passed: "if you pass neither, it defaults to 'recommended'." This goes beyond the schema's per-parameter descriptions.

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?

Description uses a specific verb+resource: "Generate a complete, best-practice set of HTTP security headers ... as copy-paste configuration." It explicitly contrasts with the sibling analyze_security_headers, saying to use this for setting up headers on a new or unscanned site, which clearly distinguishes it from similar tools.

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?

Provides explicit when-to-use guidance: "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 preset selection and gives a clear alternative for existing-site analysis.

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/RoscoNL/intodns-mcp-server'

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