Skip to main content
Glama

scan_csp

Read-onlyIdempotent

Audit a live site's Content-Security-Policy by crawling up to 20 pages, detecting missing or weak directives, and generating a ready-to-deploy CSP with report-only and enforce forms to block XSS.

Instructions

Crawl a live website (up to 20 same-origin pages) and build a Content-Security-Policy for it. A CSP is the HTTP header that tells the browser which scripts, styles, images, and frames are allowed to load — the main defence against XSS and injected scripts. This scan reads the site's current CSP (header, report-only, or meta tag), flags problems a beginner might miss (no CSP at all, unsafe-inline, wildcard sources, missing object-src/base-uri/frame-ancestors), and inventories every external origin the site actually loads per directive. Returns: the detected current policy with issues, the per-directive origin inventory, a generated ready-to-deploy CSP in both report-only form (safe to roll out first) and enforce form, plus plain-language notes explaining each directive choice. Use this when the user asks to audit, analyze, or create a Content-Security-Policy for a real site, fix CSP console errors, or harden a site against XSS; use generate_security_headers for a generic best-practice header set without crawling. Slow: the crawl typically takes 30-45 seconds, so set expectations before calling. Rate-limited to 3 scans per 10 minutes per IP; repeat scans of the same origin within 10 minutes return the cached result instantly. Read-only — nothing on the site is changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe public website URL to crawl, e.g. https://example.com
strictNoGenerate a stricter policy (fewer broad allowances)
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'Read-only — nothing on the site is changed.' It adds substantial context beyond annotations: crawls up to 20 pages, is rate-limited to 3 scans per 10 minutes, caches results for 10 minutes, and takes 30-45 seconds. These are behavioral traits an agent must know before calling.

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?

The description is long (~200 words) but well-structured: it starts with the core purpose and CSP explanation, then details the scan process, returns, usage guidance, and limitations. Each sentence adds value, but it could be tightened—the explanation of what CSP is might be considered background that the agent already knows, and the list of return items is verbose. Still, it is front-loaded and logically ordered.

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 complex tool with no output schema, the description thoroughly covers what returns (detected policy, issues, origin inventory, generated CSP, plain-language notes), performance (30-45s), rate limits (3/10min), caching behavior, and read-only nature. It also gives explicit usage context. It is complete enough for an agent to decide correctly and set expectations with the user.

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?

The input schema has 100% coverage for both parameters (url and strict) with inline descriptions. The tool description does not add additional meaning beyond the schema—it mentions the generated CSP forms but not how 'strict' affects the output. Since schema coverage is high, a baseline of 3 is appropriate, and the description neither enhances nor harms parameter understanding.

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 clearly states it crawls a website and builds a CSP, and explicitly distinguishes itself from the sibling tool generate_security_headers by mentioning alternative usage. The verb (crawl), resource (website), and outcome (CSP) are all specific and unambiguous.

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 when the user asks to audit, analyze, or create a Content-Security-Policy for a real site, fix CSP console errors, or harden a site against XSS' and names the alternative (generate_security_headers) with its key difference (no crawling). This is exactly what a usage guideline should do.

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