Skip to main content
Glama

Validate a prompt for injection attacks

validate_prompt

Check a single piece of untrusted text (a user message, a retrieved RAG document, tool output, etc.) for prompt injection, jailbreaks, instruction-override, data-exfiltration, and code injection BEFORE passing it to an LLM. Returns a safe/unsafe verdict with confidence, threat category, and reasoning.

Input Schema

NameRequiredDescriptionDefault
promptYesThe untrusted text to validate.
sensitivityNoOptional. Omit to use the account default. 'no_judgement' blocks only clear attacks, for apps whose users tell the AI exactly what to write. 'balanced' is an older name for it. 'strict' and 'lenient' are accepted for existing callers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Lacking annotations, the description provides rich behavioral context by detailing exactly what is checked (e.g., data-exfiltration, code injection) and what the response structure looks like (verdict, confidence, category, reasoning).

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?

The tool definition is highly concise, delivering maximum information—scope, purpose, and result expectations—in a single, dense, and well-structured paragraph.

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?

Even without an output schema, the description fully outlines the functionality, listing the specific types of threats addressed and the detailed, categorized nature of the returned verdict.

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 schema defines the sensitivity parameter, but the description provides crucial semantic context by explaining the operational differences between 'no_judgement,' 'balanced,' and 'strict' modes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool validates untrusted text against multiple, specific security threats (e.g., injection, jailbreaks). It clearly defines the action, though it only vaguely differentiates itself from the plural sibling, validate_prompts.

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?

It provides a clear operational guideline by stating the validation should happen 'BEFORE passing it to an LLM.' However, it fails to offer any guidance on why one would choose this singular tool over the plural sibling, validate_prompts.

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