Skip to main content
Glama

Benchline

Build a Content-Security-Policy

build_csp
Read-onlyIdempotent

Build a Content-Security-Policy from directives, or lint an existing policy. Returns the header line, a Next.js headers() snippet, and warnings for unsafe sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policyNoAn existing Content-Security-Policy value to lint. When set, directive fields are ignored.
sourcesNo
blockAllMixedContentNo
upgradeInsecureRequestsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
checksYes
headerYes
policyYes
nextConfigYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is fully covered by structured data. The description adds some value by noting that warnings are emitted for unsafe sources, but it does not disclose formatting constraints (e.g., source token syntax, semicolon joining) or limits on lintable policies.

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?

Two tight sentences with zero filler, and the primary purpose is front-loaded ahead of the secondary lint mode and the return-value note. Every clause carries information.

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

Completeness3/5

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

An output schema exists, so the description need not explain return values (though it does). The real gap is on the input side: with 4 parameters, nested required directive keys, and 25% schema coverage, two boolean switches remain completely unspecified, leaving an agent guessing how to configure mixed-content and insecure-request handling.

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

Parameters2/5

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

Schema description coverage is only 25%: only the `policy` parameter carries a schema description, and the two booleans (`blockAllMixedContent`, `upgradeInsecureRequests`) are undocumented everywhere. The description gestures at "directives" and linting a "policy" but adds no meaning for the boolean flags or the required directive keys, so it fails to compensate for the coverage gap.

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 gives a specific verb+resource ("Build a Content-Security-Policy") and explicitly covers the second mode ("or lint an existing policy"), which separates it cleanly from sibling builders like build_json_ld or build_open_graph. An agent can identify the tool's domain and dual mode without opening the schema.

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

Usage Guidelines3/5

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

The two operating modes are named, so usage is implied: supply directives to generate, or supply a policy to lint. However, it never states which mode takes precedence, what prerequisites exist, or when an agent should prefer this over a manual check_http_headers-style tool. Guidance is present but inferential.

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.

Resources