Skip to main content

Configure Delivery Behaviors

Delivery behaviors control how ThoughtJack transmits responses to the MCP client. They operate at the transport level, modifying timing, framing, or structure of the response bytes.

v0.2 feature

Delivery behaviors are a v0.2 feature. They work with the v0.2 config format (server: / baseline: / behavior:). When using OATF documents, behaviors are configured within the v0.2 config block that the actor wraps. See the examples below.

Available behaviors

BehaviorEffectTransport
normalStandard immediate deliverystdio, HTTP
slow_lorisByte-by-byte drip with delaystdio, HTTP
unbounded_lineNo newline terminatorstdio, HTTP
nested_jsonWrap in deeply nested JSONstdio, HTTP
response_delayFixed delay before responsestdio, HTTP

Slow loris

Delivers the response one byte (or chunk) at a time with a configurable delay between chunks. Tests client timeout handling and streaming resilience.

behavior:
delivery:
type: slow_loris
byte_delay_ms: 100 # milliseconds between chunks
chunk_size: 1 # bytes per chunk

What to test: Does the client timeout? Does it accumulate partial responses correctly? Does it display partial content to the user?

Unbounded line

Sends the response without a trailing newline. JSON-RPC over stdio expects newline-delimited messages - omitting it tests whether the client handles missing terminators.

behavior:
delivery:
type: unbounded_line
target_bytes: 65536 # total padding size
padding_char: " " # character used for padding

What to test: Does the client hang waiting for a newline? Does it apply a size limit?

Nested JSON

Wraps the response in deeply nested JSON objects, testing the client's JSON parser for stack depth limits.

behavior:
delivery:
type: nested_json
depth: 1000 # nesting levels
key: "data" # key name at each level

What to test: Does the parser crash? Does it apply a depth limit?

Response delay

Adds a fixed delay before sending the response. Simpler than slow loris - tests basic timeout configuration.

behavior:
delivery:
type: response_delay
delay_ms: 5000 # milliseconds before response

What to test: Does the client timeout? Does it show a loading state?

Behavior scoping

Behaviors can be set at multiple levels. The resolution order (highest priority first):

  1. Tool-level (per-tool behavior block)
  2. Phase-level (in phase configuration)
  3. Document-level (top-level behavior block)
  4. Default (normal)

Combining with side effects

Delivery behaviors and side effects are independent. You can combine them:

behavior:
delivery:
type: slow_loris
byte_delay_ms: 50
side_effects:
- type: notification_flood
rate_per_second: 10
duration_ms: 5000

This delivers the response slowly while simultaneously flooding the client with notifications.