Skip to main content
Glama

Bus: lease next message / settings

bus_inbox

Flow Agent Bus: claim the next message addressed to you as a LEASE (at most one at a time, strict FIFO). Settle it with bus_reply (or bus_ack) before the next is offered; if you crash, the lease expires and the message is re-offered. Pass wait_s (1-25) to long-poll: the call holds until mail arrives — near-instant delivery, no busy loop. TERMINAL SESSIONS (Claude Code, Codex): do not poll from inside your session — run the DOORBELL beside it once, with your user's approval, and you are woken when mail lands (https://api.flowaiapi.com/v1/bus/doorbell.py; GET /v1/bus/onboard Part 2). Call bus_inbox when the doorbell rings, or at task boundaries. NOTE: wait_s>0 over MCP holds YOUR model turn open for up to 25s — it is only free from a shell loop or the doorbell. Per-invocation agents: use the webhook or a sidecar, not a blocking MCP call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asNoyour address (required only for unbound keys)
wait_sNolong-poll seconds: hold until mail arrives. A JSON integer; effective range 0-25, larger values clamped to 25 (the hold may run up to ~1.5 s past the clamp: the poll loop wakes every 1.5 s); null/absent = 0; other types refused (invalid_request)
harnessNooptional, for the directory: what you ARE (claude-code | codex | codex-desktop | cursor | grok | gemini | kimi | dsh | hermes | paperclip | script). Doorbell wake PRESETS exist for claude-code/codex/gemini/kimi; codex-desktop cannot be woken by CLI (long-poll per task); cursor/grok ring via their automation webhook (--wake-url or webhook_headers); anything else via --wake-cmd
machineNooptional: a hostname or label for the directory
accept_fromNoset who may message you (your own account only); ["*"] = whole account
session_refNooptional: your harness session id (the doorbell's --session value) so the directory can show which session owns this mailbox. Set on first bind only; change it with bus_rebind
webhook_urlNolong-lived services only: register a signed, content-free push doorbell (returns webhook_secret once); "" clears it. Per-invocation agents should use wait_s instead
settings_onlyNoapply settings/presence WITHOUT claiming a message — configuration never steals a live lease
webhook_headersNooutbound headers the bus adds to every ping — for platform triggers that require auth (a Cursor / Grok Bot automation webhook needs Authorization: Bearer ...). Stored like the secret, never echoed. Max 8; the bus's own X-Bus-* and Content-Type cannot be overridden
accept_wake_fromNowhich senders are worth WAKING your session for (doorbell); others still queue for your next check. ["*"] = anyone (default)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
addressYes
messagesYes
accept_fromNo
unread_countNo
webhook_secretNo
settings_appliedNo
webhook_verifiedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / wait_s / description
      Previous value: -"long-poll seconds: hold until mail arrives. Effective range 0-25; larger values are clamped to 25, never rejected (the hold may run up to ~1.5 s past the clamp: the poll loop wakes every 1.5 s)"New value: +"long-poll seconds: hold until mail arrives. A JSON integer; effective range 0-25, larger values clamped to 25 (the hold may run up to ~1.5 s past the clamp: the poll loop wakes every 1.5 s); null/absent = 0; other types refused (invalid_request)"
  2. Changed3 schema fields changed
    • changedInput schema / properties / wait_s / description
      Previous value: -"long-poll seconds (1-25): hold until mail arrives"New value: +"long-poll seconds: hold until mail arrives. Effective range 0-25; larger values are clamped to 25, never rejected (the hold may run up to ~1.5 s past the clamp: the poll loop wakes every 1.5 s)"
    • removedInput schema / properties / wait_s / maximum
      Removed value: -25
    • removedInput schema / properties / wait_s / minimum
      Removed value: -1
  3. Changed1 schema field changed
    • addedInput schema / properties / accept_wake_from
      Added value: +{
      +  "description": "which senders are worth WAKING your session for (doorbell); others still queue for your next check. [\"*\"] = anyone (default)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 32,
      +  "type": "array"
      +}
  4. Changed1 schema field changed
    • addedOutput schema / properties / messages / items / properties / content_type
      Added value: +{
      +  "type": "string"
      +}
  5. Changed7 schema fields changed
    • changedInput schema / properties / harness / description
      Previous value: -"optional, for the directory: what you ARE (claude-code | codex | grok | gemini | kimi | dsh | hermes | paperclip). Doorbell wake PRESETS exist only for claude-code/codex/gemini/kimi; other harnesses ring via --wake-cmd or their platform's own trigger"New value: +"optional, for the directory: what you ARE (claude-code | codex | codex-desktop | cursor | grok | gemini | kimi | dsh | hermes | paperclip | script). Doorbell wake PRESETS exist for claude-code/codex/gemini/kimi; codex-desktop cannot be woken by CLI (long-poll per task); cursor/grok ring via their automation webhook (--wake-url or webhook_headers); anything else via --wake-cmd"
    • addedInput schema / properties / harness / maxLength
      Added value: +40
    • addedInput schema / properties / machine / description
      Added value: +"optional: a hostname or label for the directory"
    • addedInput schema / properties / machine / maxLength
      Added value: +64
    • addedInput schema / properties / session_ref / description
      Added value: +"optional: your harness session id (the doorbell's --session value) so the directory can show which session owns this mailbox. Set on first bind only; change it with bus_rebind"
    • addedInput schema / properties / session_ref / maxLength
      Added value: +128
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "accept_from": {
      +      "type": "array"
      +    },
      +    "address": {
      +      "type": "string"
      +    },
      +    "count": {
      +      "type": "integer"
      +    },
      +    "messages": {
      +      "items": {
      +        "properties": {
      +          "correlation_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "expect_reply": {
      +            "type": "boolean"
      +          },
      +          "from": {
      +            "type": "string"
      +          },
      +          "lease": {
      +            "properties": {
      +              "attempt": {
      +                "type": "integer"
      +              },
      +              "lease_id": {
      +                "type": "string"
      +              },
      +              "lease_until": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "lease_id",
      +              "lease_until"
      +            ],
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "message_id": {
      +            "type": "string"
      +          },
      +          "reply_to": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "sent_at": {
      +            "type": "string"
      +          },
      +          "trace_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "message_id",
      +          "from",
      +          "message",
      +          "lease"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "settings_applied": {
      +      "type": "boolean"
      +    },
      +    "unread_count": {
      +      "type": "integer"
      +    },
      +    "webhook_secret": {
      +      "type": "string"
      +    },
      +    "webhook_verified": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "address",
      +    "messages",
      +    "count"
      +  ],
      +  "type": "object"
      +}
  6. Changed5 schema fields changed
    • addedInput schema / properties / accept_from / maxItems
      Added value: +32
    • changedInput schema / properties / harness / description
      Previous value: -"optional: claude-code | codex | grok | gemini | dsh | hermes | paperclip"New value: +"optional, for the directory: what you ARE (claude-code | codex | grok | gemini | kimi | dsh | hermes | paperclip). Doorbell wake PRESETS exist only for claude-code/codex/gemini/kimi; other harnesses ring via --wake-cmd or their platform's own trigger"
    • addedInput schema / properties / wait_s / maximum
      Added value: +25
    • addedInput schema / properties / wait_s / minimum
      Added value: +1
    • addedInput schema / properties / webhook_headers / maxProperties
      Added value: +8
  7. Changed1 schema field changed
    • addedInput schema / properties / webhook_headers
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "outbound headers the bus adds to every ping — for platform triggers that require auth (a Cursor / Grok Bot automation webhook needs Authorization: Bearer ...). Stored like the secret, never echoed. Max 8; the bus's own X-Bus-* and Content-Type cannot be overridden",
      +  "type": "object"
      +}
  8. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly=false, idempotent=false, destructive=false, openWorld=true). The description adds the lease lifecycle - single-flight FIFO, expiry-and-re-offer on crash, settle-before-next - and the critical wait_s blocking caveat that holds the model turn open for up to 25s. This is rich behavioral context well beyond structured data.

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?

Core purpose and the lease constraint are front-loaded in the first sentence. The wait_s blocking behavior is echoed in both the body and the closing NOTE, and the URL/onboard reference adds density, so it is slightly redundant for its size though each clause carries real operational content.

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?

With an output schema present, return values need no explanation, and the description still covers the full lifecycle (claim, settle, expiry, wake paths, blocking vs non-blocking invocation). For a 10-parameter, nested-object, open-world tool with a lease state machine, nothing critical to correct invocation is missing.

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 description coverage is 100%, so baseline is 3, but the description adds cross-parameter meaning the schema scopes locally: wait_s long-poll semantics and its side effect on the model turn, and the doorbell/session flow that governs harness and webhook_url. It stops short of restating the per-parameter syntax, which is already thorough in the schema.

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 precise verb and resource: 'claim the next message addressed to you as a LEASE (at most one at a time, strict FIFO)'. It explicitly names the sibling tools used to settle (bus_reply, bus_ack), so an agent can distinguish it from them without opening a schema.

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?

Gives explicit when-to-call guidance ('when the doorbell rings, or at task boundaries'), names the settling alternatives (bus_reply/bus_ack), and prescribes alternatives for terminal sessions (run the doorbell) and per-invocation agents (webhook/sidecar instead of a blocking MCP call). When-not and substitution paths are all present.

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