Skip to main content
Glama

Scan Streaming Text Chunks

rai_stream_scan
Read-onlyIdempotent

Scan LLM streaming text chunks for PII and harmful content without a live stream. Get per-chunk results and an aggregated summary with a stop recommendation.

Instructions

Scan a list of text chunks (as would arrive from an LLM streaming response) for PII and harmful content. Simulates the StreamingScanner guardrail without a live stream. Returns per-chunk scan results and an aggregated summary with stop recommendation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chunksYesOrdered list of text chunks from LLM output stream
hard_stopNoStop processing after first PII detection
scan_windowNoScan every N chunks

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.6

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish the safe read-only, idempotent, closed-world profile, so the bar is lower. The description still adds real value by disclosing that the tool is a simulation of StreamingScanner requiring no live stream, and by naming the return shape (per-chunk results plus an aggregated summary with a stop recommendation) even though no output schema exists.

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?

Three sentences, each earning its place: what is scanned, the simulation caveat, and the return shape. The core resource and scope are front-loaded with no filler.

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?

With no output schema, the description usefully summarizes the return value, and all three parameters are fully covered by the schema. It is nearly complete for a read-only simulation tool; only the relationship to the sibling rai_scan is left unstated.

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 chunks, hard_stop, and scan_window are already documented in the schema including defaults. The description adds nothing about parameter behavior (e.g., how hard_stop interacts with the stop recommendation), so the baseline 3 applies.

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 gives a specific verb+resource ('Scan a list of text chunks ... for PII and harmful content') and scopes it to streaming LLM output, which is the key differentiator from the non-streaming sibling rai_scan. It does not name that sibling explicitly, so an agent must infer the routing from the word 'streaming'.

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?

'Simulates the StreamingScanner guardrail without a live stream' implies a testing/simulation context, but the description never states when to choose this over rai_scan or any other scan tool, nor any prerequisites. Usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.