Skip to main content
Glama
naoanao

Safe AI Agent — Guard Checks

by naoanao

Check Idempotency Pattern

check_idempotency_pattern

Scans code snippets for idempotency guard signals that prevent duplicate side effects and reports which protections are present, missing, and the verdict.

Instructions

Check a code snippet for the signals that stop duplicate execution.

Paste the function that performs the side effect (sending, charging, writing). Returns which guard signals are present, which are missing, and a plain verdict. Read-only static check — the code is not executed.

Input Schema

NameRequiredDescriptionDefault
codeYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does so: 'Read-only static check — the code is not executed' discloses the safety profile, and it says the result is a per-signal present/missing breakdown plus a verdict. It omits anything about how the guarded patterns are recognized or limits on snippet size, so not a 5.

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 short sentences with no filler: purpose first, input instruction second, safety and output character last. Every sentence adds information an agent needs.

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?

A one-parameter tool with an output schema present; the description covers what to pass, that it is static and read-only, and the shape of the answer in general terms. Nothing material is missing for correct invocation.

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?

Schema description coverage is 0% for the single 'code' parameter, so the description must compensate and largely does by specifying that the value should be the function performing the side effect, with examples of side-effect kinds. It does not say whether surrounding file scope or callers matter, leaving a small ambiguity.

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?

States a specific verb (check) and resource (a code snippet) plus the domain concept it evaluates: signals that stop duplicate execution. An agent can distinguish it from explain_guard_pattern and audit_api_keys, though the phrase 'signals that stop duplicate execution' is slightly abstract where 'idempotency guards' would be sharper.

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?

'Paste the function that performs the side effect (sending, charging, writing)' gives a clear, actionable condition for when to use the tool and what input scope is expected. It stops short of naming when to use a sibling instead, so it does not reach a 5.

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