Skip to main content
Glama

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.

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": "build_csp"
  }
}

Input Schema

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

Output Schema

NameRequiredDescriptionDefault
checksYes
headerYes
policyYes
nextConfigYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, closed-world behavior, so the description's job is to add more than the safety profile — and it does, disclosing that the tool emits warnings for unsafe sources, which is behavioral information absent from the annotations. It stops short of saying how severe those warnings are or what makes a source 'unsafe', and it does not flag that sources mode requires all 14 directives, which is the most consequential behavioral constraint.

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 sentences, zero filler, with the primary build action front-loaded and the secondary lint mode and return contents trailing. Nothing could be removed without losing information.

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?

An output schema exists, so the description need not explain the header line or Next.js snippet, and listing them is only light reinforcement. For a four-parameter tool with a nested fourteen-key object, the remaining gap is the undisclosed directives structure and the two boolean options, which keeps this below a 5.

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?

At 25% schema coverage the description must compensate, and it partially does by naming the two input modes ('directives' and 'existing policy'). However it never mentions the blockAllMixedContent and upgradeInsecureRequests toggles, nor that the nested sources object requires all fourteen directives, leaving half the parameter surface to be discovered from the schema alone.

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 ('Build a Content-Security-Policy from directives') plus a clearly named second mode (lint an existing policy), and lists what the result contains. An agent can tell immediately that this is a policy generator/linter, not a JSON-LD or headers tool like its siblings.

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 modes are named, so usage is implied: pass directives to build, pass a policy string to lint. But there is no explicit 'use this when...' guidance, no statement that the two modes are mutually exclusive in practice (that fact lives only in the schema's 'when set, directive fields are ignored'), and no direction to any alternative tool.

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.