Skip to main content
Glama

guarded_generate

Destructive

Scans prompts for secrets, PII, code, and jailbreak risks, enforces model policy and risk thresholds, logs usage, and calls Ollama only when allowed. Raw prompts are never stored.

Instructions

[WRITE][risk=medium] Scan + policy-gate a prompt, record it, then run if allowed.

The route-through guard: scans the prompt (secrets/PII/code/jailbreak), checks the model against policy, blocks if the risk band >= block_threshold or the model is disallowed, records the interaction to the usage log, and only calls Ollama if allowed. The raw prompt is never stored.

Args: model: Model to run. prompt: The prompt text (scanned before any model call). agent / user: Actor attribution recorded in the usage log. block_threshold: Block when risk band >= this (none/low/medium/high/critical). target: Ollama target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNo
agentNounknown
modelYes
promptYes
targetNo
block_thresholdNohigh

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: scan targets (secrets/PII/code/jailbreak), the block condition, the usage-log record, and the guarantee that the raw prompt is never stored. The annotations' destructiveHint=true goes unexplained since nothing in the described flow is destructive, but this is a mild gap rather than a direct contradiction.

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?

Front-loaded with [WRITE][risk=medium] and a one-line summary before the flow detail, then a compact Args block. Dense but every sentence carries information; only the repetition of the scan/gate sequence in both summary and body costs a little.

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?

For a no-output-schema mutation tool with six parameters, the description covers inputs, gating logic, and side effects (usage log, no prompt retention) well. It stops short of describing the shape of a blocked or successful response, which is the one thing an agent cannot infer from the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates fully: it documents all six parameters, gives the risk-band vocabulary for block_threshold (none/low/medium/high/critical) which the schema lacks as an enum, and explains target's default behavior. It adds real meaning the schema does not carry.

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?

Names a specific pipeline (scan + policy-gate + record + conditional generate) and states the key verb ordering, which clearly separates it from the plain sibling scan_prompt. An agent can tell that this is the guarded generate path, not merely a scanner.

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 makes the use context explicit ('run if allowed', 'only calls Ollama if allowed') and ties the gating behavior to the block_threshold parameter. It does not, however, compare itself against scan_prompt or a bare generate path, so the agent must infer when to pick this over those.

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