Skip to main content
Glama

Prompt Template Scan

prompt_scan
Read-onlyIdempotent

Scan prompt template files to find prompt injection and unsafe interpolation risks, catching vulnerabilities that package scans miss.

Instructions

Scan prompt template files for prompt-injection and unsafe-interpolation risks.

    Walks the given directory for prompt assets (``.prompt`` files,
    ``system_prompt.*``, and ``prompts/`` directories), then statically
    inspects each template for injection-prone patterns and unsafe variable
    interpolation (untrusted input concatenated into instructions, missing
    delimiters, tool/role-confusion phrasing).

    Args:
        directory: Directory path to scan for prompt template files.

    Returns:
        JSON with the scanned files, per-file findings (rule id, severity,
        line, message), and a summary count by severity.

    Use this before shipping or registering agent prompts to catch
    injection exposure that package and CVE scans do not cover.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryYesDirectory path to scan for prompt template files (.prompt, system_prompt.*, prompts/ directories).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare read-only, non-destructive, idempotent, and open-world behavior. The description adds value by detailing the walking of directories and static inspection for specific patterns, which goes beyond the annotations.

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?

At approximately 100 words, the description is concise. It is front-loaded with the purpose, followed by args, returns, and usage guidance, with no unnecessary sentences.

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 the presence of an output schema, the description succinctly describes the return value. The tool is simple (one parameter), and the description covers purpose, behavior, and usage adequately.

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?

The single parameter 'directory' is fully documented in the schema, but the description adds context about the file types scanned (.prompt, system_prompt.*, prompts/), which enriches the parameter semantics.

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 clearly states the tool scans prompt template files for prompt-injection and unsafe-interpolation risks, specifying the verb 'scan' and the resources (prompt files). It distinguishes itself from sibling tools that focus on code or model scans.

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

Usage Guidelines4/5

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

The description explicitly says to use this before shipping or registering agent prompts, and contrasts with package and CVE scans to indicate complementary usage. It provides clear context but does not list alternative tools.

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/msaad00/agent-bom'

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