Skip to main content
Glama

Draft Rule from Natural Language

draft_rule

Draft an automation rule from a plain-language description (e.g. 'block POs over $10k when created'). On success returns a DISABLED draft rule alongside any detected conflicts, an approver hint and the Spark bot it was filed under with the reason (botSuggestion; pass another bot's id as botId to update_rule to move it). The rule is saved but inactive — review and enable it via update_rule. Returns declined reason or validation errors when the model cannot produce a valid rule.

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": {
      "nlText": "<nlText>"
    },
    "name": "draft_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nlTextYesPlain-language rule description.

Output Schema

NameRequiredDescriptionDefault
okNo
ruleNo
errorsNo
conflictsNo
approverHintNo
errorMessageNo
botSuggestionNo
declinedReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that the produced rule is persisted but inactive, that conflicts and an approver hint are returned, that the Spark bot and its botSuggestion are attached, and that failures surface as a declined reason or validation errors. These are exactly the side-effect and outcome details an agent needs before invoking a non-readOnly, non-idempotent tool.

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?

Purpose is front-loaded with an example, followed by success behavior and then failure behavior in a logical order. The botSuggestion parenthetical is dense and interrupts the flow slightly, but no sentence is pure 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?

For a single-parameter tool with an output schema, the description covers input expectations, side effects, and failure modes completely. It spends notable space restating return contents that the output schema already declares, at the cost of sibling differentiation, but nothing an agent needs to call it correctly is missing.

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?

With one parameter at 100% schema coverage, the schema already carries the contract; the description only reinforces that nlText is plain language by giving an example. The botId mention explicitly refers to update_rule, not to this tool's parameters, which is clarifying rather than additive.

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?

States a specific verb and resource ('Draft an automation rule') plus the input modality ('from a plain-language description') and gives a concrete example ('block POs over $10k when created'). The 'DISABLED draft' framing and the pointer to update_rule for enabling make the tool's distinct role clear without opening any schema.

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 intended workflow is spelled out: draft here, then 'review and enable it via update_rule', and moving a rule to another bot goes through update_rule with botId. It does not explicitly contrast this with create_rule or check_rule_conflicts, so the agent must still infer when a hand-written rule is preferable to a drafted one.

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.

Resources