Skip to main content
Glama

set_rule_chaos

Configure Rule-level Chaos for a specific conditional rule inside a mock. Unlike Global Traffic Chaos (which intercepts all requests), Rule-level Chaos only activates when the rule's conditions have already matched. For example: rule matches 'name=agung', then 30% chance the connection is killed instead of returning the rule's normal response. Supports two modes: 'probability' (random per-request) and 'sequential_fail' (fail first N requests, then pass, cycling).

Input Schema

NameRequiredDescriptionDefault
modeYes'probability': chaos fires randomly with failureRate probability on each request (0.0=never, 1.0=always). 'sequential_fail': chaos fires for the first maxFailCount requests in a cycle, then passes on the (maxFailCount+1)-th, then repeats.
mockIdYesDatabase ID of the mock endpoint
ruleIdYesDatabase ID of the rule to attach chaos to. Obtain from get_mock_detail.
behaviorYes'error_response': return this rule's configured responseStatus and responseBody normally. 'kill_connection': drop TCP connection — no HTTP response, client gets connection reset.
projectIdYesDatabase ID of the project
failureRateNoUsed when mode='probability'. Float between 0.0 (never fires) and 1.0 (always fires). E.g. 0.3 = 30% chance of chaos.
maxFailCountNoUsed when mode='sequential_fail'. Number of consecutive requests that trigger chaos before one passes through. E.g. 3 = fail 3 times, pass once, repeat.
resetAfterMsNoOptional. For sequential_fail mode only: automatically reset the counter if no requests arrive within this many milliseconds. 0 = never auto-reset.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does substantial work: it explains activation timing (post-condition-match), both modes, and that kill_connection drops TCP with no HTTP response. It omits whether an existing chaos config is replaced, what permissions are needed, and what is returned on success.

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?

It is short and front-loaded: the scoping distinction comes first, then modes, with no filler sentences. The trailing mode enumeration slightly duplicates what the schema's enum descriptions already say.

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?

For an 8-parameter mutation tool with no annotations, no output schema, and full schema coverage, the description supplies the two missing pieces an agent needs: when the chaos actually fires and what each behavior does to the client connection. Nothing essential is absent.

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?

Schema description coverage is 100%, so the schema already documents every parameter including enum semantics for mode and behavior. The description's worked example ('name=agung', 30% kill) and mode summary add conceptual framing rather than new parameter-level meaning, which fits the baseline 3.

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 uses a specific verb+resource ('Configure Rule-level Chaos for a specific conditional rule inside a mock') and explicitly contrasts itself with Global Traffic Chaos, which is the sibling set_traffic_chaos. An agent can distinguish the two without opening either 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?

It states the key selection condition clearly: rule-level chaos only activates after the rule's conditions match, unlike global chaos which intercepts all requests. It does not, however, name the sibling tools by name (set_traffic_chaos, clear_rule_chaos, get_rule_chaos_status), so the routing advice stops short of explicit alternatives.

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