Skip to main content
Glama

guard

Check a monadic condition on a reference to enforce constraints before passing to downstream combinators. Returns the reference on success, error on failure.

Instructions

Check a monadic condition on a ref. Returns the ref if the guard passes, error if not.

Use to enforce constraints before passing refs to downstream combinators.

Args: ref: A ref string or JSON object. check: The guard to check — one of: "validated", "budget", "classification", "encrypted", "exists". value: Required for some checks — e.g. the type name for "validated", the classification level for "classification".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes
checkYes
valueNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description must carry the full burden of behavioral disclosure. It states the outcome (returns ref or error) but does not disclose side effects, permissions, or whether the operation is read-only. The mention of 'monadic condition' is vague. This leaves ambiguity about non-obvious behaviors.

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?

The description is concise (4 lines plus Args block) and well-structured. It provides essential information without unnecessary verbosity. The use of an Args section clearly delineates parameter explanations.

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?

Given the tool's moderate complexity (3 parameters, no annotations, output schema exists), the description covers purpose, parameters, and basic behavior. It mentions the output (ref or error) but does not detail the output schema structure. Still, this is sufficient for an agent to use the tool correctly in most scenarios.

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%, so the description must compensate. It explains the 'check' parameter's enum values explicitly and provides examples for 'value' (e.g., type name for validated). However, the description for 'ref' says 'string or JSON object' while the schema defines it as 'string', which creates a minor inconsistency.

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 it checks a monadic condition on a ref and returns the ref or an error. It names specific check types, which aids understanding. However, it does not explicitly differentiate from sibling tools like 'validate' or 'filter', which may have overlapping functionality.

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 explicitly states 'Use to enforce constraints before passing refs to downstream combinators.' This provides clear usage context. It does not mention when not to use or alternative tools, but the context is sufficient for basic guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stiege/swarm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server