Skip to main content
Glama

Scan text for threats

promptguard_scan_text
Read-only

Scan text for security threats including prompt injection, jailbreaks, PII leakage, and toxic content. Returns a decision (allow/block), confidence score, threat type, and reason. Each call counts as one Request on your PromptGuard plan. When to use: When reviewing user-facing prompts, testing LLM inputs for safety, or verifying that content is free of injection attacks before sending to an LLM.

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": {
      "text": "<text>"
    },
    "name": "promptguard_scan_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text content to scan for security threats
content_typeNoWhether the text is a prompt sent to a model or a model's responseprompt

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "blocked": {
      -        "type": "boolean"
      -      },
      -      "confidence": {
      -        "type": "number"
      -      },
      -      "decision": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "scan"
      -      },
      -      "reason": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "threatType": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "blocked",
      -      "decision",
      -      "confidence"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "code": {
      -        "type": "string"
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "error"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "blocked": {
      +        "type": "boolean"
      +      },
      +      "confidence": {
      +        "type": "number"
      +      },
      +      "dashboard_url": {
      +        "description": "The event's page in the dashboard, to show your user.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "decision": {
      +        "type": "string"
      +      },
      +      "event_id": {
      +        "description": "The event this scan recorded (hosted server).",
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "scan"
      +      },
      +      "reason": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "threatType": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "blocked",
      +      "decision",
      +      "confidence"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "error"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "blocked": {
      -        "type": "boolean"
      -      },
      -      "confidence": {
      -        "type": "number"
      -      },
      -      "decision": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "scan"
      -      },
      -      "reason": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "threatType": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "blocked",
      -      "decision",
      -      "confidence"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "type": [
      -          "string",
      -          "object"
      -        ]
      -      },
      -      "kind": {
      -        "const": "error"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "blocked": {
      +        "type": "boolean"
      +      },
      +      "confidence": {
      +        "type": "number"
      +      },
      +      "decision": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "scan"
      +      },
      +      "reason": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "threatType": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "blocked",
      +      "decision",
      +      "confidence"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "error"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description adds real value beyond that: an explicit billing constraint ('Each call counts as one Request on your PromptGuard plan') and the shape of the verdict (allow/block, confidence, threat type, reason).

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?

Two-tier structure (what it does, then when to use) with the core capability front-loaded and no filler. Minor redundancy in restating the return fields in prose when an output schema already exists.

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 covers return values and annotations cover safety, so the description only needs scope, cost, and timing. It supplies the billing unit, which is the main hidden cost an agent could trip over; error behavior and latency expectations are not stated but are minor for a two-parameter read tool.

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 both parameters, including the prompt/response enum and its default, are already documented in structured form. The description adds no additional semantics about how 'content_type' changes detection behavior, so the baseline 3 applies.

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?

Starts with a specific verb and resource ('Scan text for security threats') and enumerates the exact threat classes covered: prompt injection, jailbreaks, PII leakage, toxic content. The 'text' scope also separates it from the code-scanning sibling without needing to name it.

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?

An explicit 'When to use' clause gives three concrete contexts: reviewing user-facing prompts, testing LLM inputs for safety, and verifying content before sending to an LLM. It stops short of exclusions or naming alternatives such as promptguard_redact or promptguard_scan_code for adjacent cases, so it is clear context without routing.

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.