Skip to main content
Glama

csp-audit

Content-Security-Policy audit — Parses a Content-Security-Policy header or value and reports every clause that weakens it: 'unsafe-inline' without nonces or hashes, 'unsafe-eval', wildcard hosts, data:/blob: in script-src, scheme-only https:, duplicate directives (second is discarded), missing base-uri or object-src 'none', open frame-ancestors or form-action, and the strict-dynamic cases that silently ignore host sources

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "policy": "<policy>"
    },
    "name": "csp-audit"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYesThe full Content-Security-Policy value (not the header line).
deployTargetNoReserved for future harsher checks in enforce mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose non-obvious analysis semantics: duplicate directives where the second is discarded, and strict-dynamic cases that silently ignore host sources. It still omits the safety profile (pure static analysis, no network fetch) and any hint of result shape or ordering.

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-loaded with the tool's name and core action, then a dense enumeration where each item is a distinct, useful check. It is a single long sentence, so the enumeration is harder to scan than a short structured list, but no wording is wasted.

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?

The tool is simple (2 params, 1 required, flat schema) and the analysis scope is well covered. However, there is no output schema, so the description should say more about what the report looks like (per-finding structure, severity, whether it fails fast) — that gap is left unaddressed.

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?

Schema description coverage is 100%, so the schema already documents both parameters, including that 'policy' is the value and not the header line and that deployTarget is reserved. The description adds no additional parameter meaning, which matches the baseline of 3 for full schema coverage.

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 — parses a Content-Security-Policy header or <meta> value and reports weakening clauses — then enumerates concrete checks ('unsafe-inline' without nonces, wildcard hosts, duplicate directives, missing base-uri, open frame-ancestors). This is clearly distinct from siblings like cors-preflight or http-cache-explain.

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?

Usage is implied: hand it a policy string and get an audit. But there is no explicit when-to-use/when-not-to-use guidance, no mention of alternatives for related header analysis, and no stated prerequisites (e.g., that it does not fetch the header itself).

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