Skip to main content
Glama

set_agent_condition

DestructiveIdempotent

Run a scheduled agent ONLY when there is something new, instead of purely by the clock. When the agent is due, the server first counts matching rows (cheap SQL); with no hit the run is skipped and costs nothing. Combine with a short cadence (e.g. every 5 minutes) for near event-driven behaviour. Each check: source (see get_agent_condition), plus within_minutes (hits in the last N minutes) OR since_last_run=true. match 'any' (default) or 'all'. Pass remove=true to drop the condition. preset 'takt_scharf' (instead of checks) = wake only on this agent's own new/changed open todos, handoffs to it not yet picked up, new/changed OPEN Pipedrive deals, new lab results and changed asbestos (IK) projects since the last run — the recommended condition for hourly agents. Owner of the agent or tenant admin only.

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": {
      "agent_id": "<agent_id>"
    },
    "name": "set_agent_condition"
  }
}

Input Schema

NameRequiredDescriptionDefault
matchNoany: one check must hit (default); all: every check must hit
checksNoConditions that must find new rows before the agent runs
presetNoPredefined condition instead of checks; recommended for hourly agents
removeNotrue drops the agent's condition
agent_idYesID of the agent

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / agent_id / description
      Added value: +"ID of the agent"
    • addedInput schema / properties / checks / description
      Added value: +"Conditions that must find new rows before the agent runs"
    • addedInput schema / properties / checks / items / properties / since_last_run / description
      Added value: +"Count hits since the agent's last run"
    • addedInput schema / properties / checks / items / properties / source / description
      Added value: +"Data source and event to count, e.g. new emails or changed leads"
    • addedInput schema / properties / checks / items / properties / within_minutes / description
      Added value: +"Count hits from the last N minutes"
    • addedInput schema / properties / match / description
      Added value: +"any: one check must hit (default); all: every check must hit"
    • addedInput schema / properties / preset / description
      Added value: +"Predefined condition instead of checks; recommended for hourly agents"
    • addedInput schema / properties / remove / description
      Added value: +"true drops the agent's condition"
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, so the description's job is to explain what is destroyed — and it does, by stating remove=true drops the agent's condition. It further adds the cost model (a cheap SQL row count, no hit means the run is skipped and costs nothing) and the permission requirement, neither of which appears in annotations. It stops short of saying what happens to an existing condition when a new one is set, or what the call returns.

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 purpose is front-loaded in the first clause and every subsequent sentence carries operational information. The prose is dense and slightly run-on in the preset enumeration, but there is no filler or restatement of the tool name.

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 five-parameter mutation with no output schema, the definition covers purpose, cost, permissions, preset semantics, and removal. The remaining gap is what a successful set/removal returns and whether setting overwrites an existing condition, which an agent would want to know before calling.

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 coverage is 100%, so a baseline of 3 is warranted, but the description goes further: it explains the OR relationship between within_minutes and since_last_run, clarifies that match 'any' is the default, and spells out what preset 'takt_scharf' actually watches (own open todos, handoffs, open Pipedrive deals, lab results, IK projects) where the schema only says 'predefined condition'.

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?

The description opens with a specific verb and outcome: gate a scheduled agent so it runs only when new rows exist, rather than on the clock. It distinguishes itself from the sibling get_agent_condition by explicitly pointing there for source definitions, and it names the two configuration modes (checks vs. preset).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states when to use it (instead of purely clock-based scheduling), how to combine it (short cadence such as every 5 minutes for near event-driven behaviour), the recommended configuration for a specific case (preset 'takt_scharf' for hourly agents), and the removal path (remove=true). It also states the authorization prerequisite: owner of the agent or tenant admin only.

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.