Skip to main content
Glama

set_traffic_chaos

Configure Global Traffic Chaos for a mock API. This enables probabilistic or exact round-robin traffic distribution across multiple outcome channels: 'drop' (kills TCP connection — client gets connection reset), 'error' (returns HTTP error status), 'rule' (routes traffic to a specific conditional rule), and 'default' (serves the normal mock response). IMPORTANT: The 'rate' of all targets MUST add up to exactly 100. If they do not, this tool will return an error. For 'rule' type targets, obtain the ruleId by calling get_mock_detail first. Chaos is evaluated BEFORE any rule conditions — if a request is dropped, it never reaches rule logic.

Input Schema

NameRequiredDescriptionDefault
mockIdYesDatabase ID of the mock endpoint to configure chaos on
enabledYesWhether to enable or disable Global Traffic Chaos
targetsYesList of traffic distribution channels. The sum of all 'rate' values MUST equal 100 exactly.
errorBodyNoOptional JSON body to return for 'error' type targets. Defaults to empty if not specified.
projectIdYesDatabase ID of the project
errorStatusNoHTTP status code to return for 'error' type targets. Defaults to 500 if not specified.
distributionModeYes'probabilistic' = each request is randomly assigned a channel (like a dice roll). 'exact' = requests cycle through channels in a deterministic round-robin order, guaranteeing exact percentages over time.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it explains the rate-sum failure condition, TCP drop behavior, HTTP error behavior, rule routing, and that chaos is evaluated before rule logic. It does not explicitly state whether existing chaos configuration is overwritten or what permissions are required.

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?

The description is front-loaded with purpose and constraints, and every sentence earns its place by defining channels, modes, failure conditions, prerequisites, or evaluation order.

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?

Given the complex mutation behavior, absence of annotations, and no output schema, the description provides enough context to call the tool correctly: required distribution sum, ruleId sourcing, channel meanings, and evaluation ordering are all covered.

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 parameter semantics are already well documented in the schema. The description reinforces the sum-to-100 constraint and ruleId source, but adds little beyond what the schema fields already state.

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 states a specific verb and resource: configure Global Traffic Chaos for a mock API. It clearly distinguishes this from status/clear operations by describing configuration of traffic distribution and the supported channels.

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 gives clear context for use, including the ruleId prerequisite via get_mock_detail and the evaluation ordering before rule conditions. It does not explicitly name when to use this versus clear_traffic_chaos, get_traffic_chaos_status, or set_rule_chaos, so it stops short of full alternative routing guidance.

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