Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Record external wait in visible plan

record_external_wait_in_plan
DestructiveIdempotent

Generic factual plan helper for the moment after a domain tool starts asynchronous work and returns a real externalWaitId. Identity and revision come from that stored hook wait; pass externalWaitId instead of copying externalKind, externalId, revisionId, or sourceExternalId. Legacy identity fields are optional assertions and must match the stored record. It turns waitingItemTarget into the waiting row. With an explicit currentItemTarget and no waitingItemTarget or waitingItem, that current unfinished item becomes the waiting row. When both targets name the same unfinished item, that item waits without claiming completion. Otherwise it completes the current launch step, reusing that row's label and completion criteria when waitingItem is omitted, or appends one waiting row only when that future work is not already visible. Both targets are selector objects with type=id/itemId or type=position/position, never bare UUID strings. A current retry or validation row awaiting its own external result must be the waiting target too; do not attach the new wait to a completed parent or an earlier failed attempt. Use the latest returned activePlan IDs/order. waitingItemTarget may identify the same unfinished current row or a later row; omit it when waitingItem defines a new row. If both targets accidentally identify the current row and a complete waitingItem is supplied, the helper safely appends that new row after the current item. It carries the returned facts without matching or interpreting item labels. It does not start, stop, retry, interpret, or otherwise change external work. Do not call it when the domain tool failed or returned no externalWaitId. Once this succeeds, stop calling plan tools and do not call complete_plan while any item is waiting.

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": {
      "externalWaitId": "<externalWaitId>"
    },
    "name": "record_external_wait_in_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
planIdNoOptional plan UUID. In the current conversation, omit planId unless you already have the actual plan id from get_active_plan or a wake message. Never pass a plan item id here; target plan items through target.itemId or target.position.
evidenceNo
externalIdNoOptional assertion against the stored hook identity. Prefer externalWaitId alone.
revisionIdNo
waitingItemNoWaiting-row fields for a newly inserted row or intentional overrides for a distinct existing waitingItemTarget. When this defines a new row, omit waitingItemTarget. Omit waitingItem when waitingItemTarget already identifies the complete future row.
externalKindNoOptional assertion against the stored hook identity. Prefer externalWaitId alone.
conversationIdNoOptional conversation UUID. Omit this field to use the current MCP conversation context; never pass placeholders such as `current`.
externalWaitIdYesThe durable external wait id returned by the same domain-tool result.
sourceExternalIdNo
currentItemTargetNoA structured target object, never a bare UUID or number. Use {"type":"id","itemId":"<actual item UUID returned by get_active_plan>"} or {"type":"position","position":3}. This identifies the visible plan item advanced by the domain tool. Omit to use the current actionable item. After adding a retry row, use that current retry row, not its completed parent.
waitingItemTargetNoA structured target object, never a bare UUID or number. Use {"type":"id","itemId":"<actual item UUID returned by get_active_plan>"} or {"type":"position","position":3}. The unfinished item whose completion requires this external result. Omit this selector and waitingItem to reuse an explicitly selected unfinished currentItemTarget as the waiting row. For a current retry/validation row, target that same unfinished row; do not target its completed parent or a previous failed attempt. Otherwise choose a later visible row when the current launch step is complete. Read IDs and order from the latest returned activePlan. Omit when waitingItem defines a new row.
currentItemOutcomeNo
currentItemEvidenceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changed
    • addedInput schema / properties / conversationId / anyOf
      Added value: +[
      +  {
      +    "format": "uuid",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / conversationId / format
      Removed value: -"uuid"
    • removedInput schema / properties / conversationId / type
      Removed value: -"string"
    • changedInput schema / properties / currentItemTarget / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "itemId": {
      -        "$ref": "#/properties/conversationId"
      -      },
      -      "type": {
      -        "const": "id",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "type",
      -      "itemId"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "position": {
      -        "maximum": 100,
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "type": {
      -        "const": "position",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "type",
      -      "position"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "itemId": {
      +            "$ref": "#/properties/conversationId/anyOf/0"
      +          },
      +          "type": {
      +            "const": "id",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "itemId"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "position": {
      +            "maximum": 100,
      +            "minimum": 1,
      +            "type": "integer"
      +          },
      +          "type": {
      +            "const": "position",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "position"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / externalId / anyOf
      Added value: +[
      +  {
      +    "maxLength": 160,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / externalId / maxLength
      Removed value: -160
    • removedInput schema / properties / externalId / minLength
      Removed value: -1
    • removedInput schema / properties / externalId / type
      Removed value: -"string"
    • addedInput schema / properties / externalKind / anyOf
      Added value: +[
      +  {
      +    "maxLength": 80,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / externalKind / maxLength
      Removed value: -80
    • removedInput schema / properties / externalKind / minLength
      Removed value: -1
    • removedInput schema / properties / externalKind / type
      Removed value: -"string"
    • changedInput schema / properties / planId / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/properties/conversationId"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "$ref": "#/properties/conversationId/anyOf/0"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / revisionId / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/properties/conversationId"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "$ref": "#/properties/conversationId/anyOf/0"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / waitingItem / additionalProperties
      Removed value: -false
    • addedInput schema / properties / waitingItem / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "completionCriteria": {
      +        "maxLength": 1200,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "dependsOnItemIds": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "$ref": "#/properties/conversationId/anyOf/0"
      +            },
      +            "maxItems": 20,
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "evidence": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": {},
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "label": {
      +        "maxLength": 240,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "parentItemId": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/properties/conversationId/anyOf/0"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "rationale": {
      +        "anyOf": [
      +          {
      +            "maxLength": 1000,
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "waitDetails": {
      +        "anyOf": [
      +          {
      +            "maxLength": 1200,
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "required": [
      +      "label",
      +      "completionCriteria"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / waitingItem / properties
      Removed value: -{
      -  "completionCriteria": {
      -    "maxLength": 1200,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "dependsOnItemIds": {
      -    "anyOf": [
      -      {
      -        "items": {
      -          "$ref": "#/properties/conversationId"
      -        },
      -        "maxItems": 20,
      -        "type": "array"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "evidence": {
      -    "anyOf": [
      -      {
      -        "additionalProperties": {},
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "label": {
      -    "maxLength": 240,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "parentItemId": {
      -    "anyOf": [
      -      {
      -        "$ref": "#/properties/conversationId"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "rationale": {
      -    "anyOf": [
      -      {
      -        "maxLength": 1000,
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "waitDetails": {
      -    "anyOf": [
      -      {
      -        "maxLength": 1200,
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  }
      -}
    • removedInput schema / properties / waitingItem / required
      Removed value: -[
      -  "label",
      -  "completionCriteria"
      -]
    • removedInput schema / properties / waitingItem / type
      Removed value: -"object"
    • removedInput schema / properties / waitingItemTarget / $ref
      Removed value: -"#/properties/currentItemTarget"
    • addedInput schema / properties / waitingItemTarget / anyOf
      Added value: +[
      +  {
      +    "$ref": "#/properties/currentItemTarget/anyOf/0"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed2 schema fields changed
    • changedInput schema / properties / currentItemTarget / description
      Previous value: -"Selector object for the visible item advanced by the domain tool: {\"type\":\"id\",\"itemId\":\"<visible item UUID>\"} or {\"type\":\"position\",\"position\":3}. Omit to use the current actionable item. After adding a retry row, use that current retry row, not its completed parent."New value: +"A structured target object, never a bare UUID or number. Use {\"type\":\"id\",\"itemId\":\"<actual item UUID returned by get_active_plan>\"} or {\"type\":\"position\",\"position\":3}. This identifies the visible plan item advanced by the domain tool. Omit to use the current actionable item. After adding a retry row, use that current retry row, not its completed parent."
    • changedInput schema / properties / waitingItemTarget / description
      Previous value: -"Selector OBJECT for the unfinished item whose completion requires this external result, never a bare UUID string. Use {\"type\":\"id\",\"itemId\":\"<visible item UUID>\"} or {\"type\":\"position\",\"position\":3}. Omit this selector and waitingItem to reuse an explicitly selected unfinished currentItemTarget as the waiting row. For a current retry/validation row, target that same unfinished row; do not target its completed parent or a previous failed attempt. Otherwise choose a later visible row. Read IDs and order from the latest returned activePlan. Omit when waitingItem defines a new row."New value: +"A structured target object, never a bare UUID or number. Use {\"type\":\"id\",\"itemId\":\"<actual item UUID returned by get_active_plan>\"} or {\"type\":\"position\",\"position\":3}. The unfinished item whose completion requires this external result. Omit this selector and waitingItem to reuse an explicitly selected unfinished currentItemTarget as the waiting row. For a current retry/validation row, target that same unfinished row; do not target its completed parent or a previous failed attempt. Otherwise choose a later visible row when the current launch step is complete. Read IDs and order from the latest returned activePlan. Omit when waitingItem defines a new row."
  3. Changed2 schema fields changed
    • changedInput schema / properties / currentItemTarget / description
      Previous value: -"The visible plan item advanced by the domain tool. Omit to use the current actionable item."New value: +"Selector object for the visible item advanced by the domain tool: {\"type\":\"id\",\"itemId\":\"<visible item UUID>\"} or {\"type\":\"position\",\"position\":3}. Omit to use the current actionable item. After adding a retry row, use that current retry row, not its completed parent."
    • changedInput schema / properties / waitingItemTarget / description
      Previous value: -"An already-visible future plan item that should become the waiting row. It must be strictly after currentItemTarget and must not identify the same item. Omit it when waitingItem defines a new row to insert."New value: +"Selector OBJECT for the unfinished item whose completion requires this external result, never a bare UUID string. Use {\"type\":\"id\",\"itemId\":\"<visible item UUID>\"} or {\"type\":\"position\",\"position\":3}. Omit this selector and waitingItem to reuse an explicitly selected unfinished currentItemTarget as the waiting row. For a current retry/validation row, target that same unfinished row; do not target its completed parent or a previous failed attempt. Otherwise choose a later visible row. Read IDs and order from the latest returned activePlan. Omit when waitingItem defines a new row."
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare openWorld, idempotent and destructive, so the safety profile is covered; the description adds real behavioral detail on top, including that it completes the current launch step versus appending a row, that it reuses the row's label and completion criteria, and that a duplicate-target case safely appends rather than failing. It also bounds the blast radius ('does not start, stop, retry, interpret, or otherwise change external work'). It says nothing about what the call returns or how a caller confirms the row landed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the body is a dense block with long compound sentences such as the one joining completion, label reuse, and append-only-if-not-visible into a single clause. It also restates schema-level facts ('Both targets are selector objects with type=id/itemId or type=position/position, never bare UUID strings') that the schema description already covers verbatim in spirit, diluting the sentences that do add value.

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 13-parameter destructive mutation with no output schema, the description does the hard work of covering the identity, selector, and branch semantics that an agent would otherwise have to infer. The remaining gap is the return value and how the caller verifies the resulting waiting row, which matters here because no output schema exists to fill it in.

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?

With 13 parameters at 62% schema coverage, the description carries real weight: it explains that externalWaitId is authoritative and that externalKind/externalId/revisionId/sourceExternalId are optional assertions that must match the stored record, and it explains the interaction between waitingItem and waitingItemTarget, including that omitting both reuses the current target. It repeats the selector-object constraint that the schema already states for both target fields, which is wasted effort at this coverage level.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource: it records an external wait into the visible plan at the moment a domain tool returns a real externalWaitId. It distinguishes itself from domain tools and from complete_plan by naming both, but the core purpose is then buried under a long chain of branch conditions rather than stated once crisply.

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?

It states explicit preconditions ('the moment after a domain tool starts asynchronous work and returns a real externalWaitId'), an explicit exclusion ('Do not call it when the domain tool failed or returned no externalWaitId'), and an explicit post-condition ('Once this succeeds, stop calling plan tools and do not call complete_plan while any item is waiting'). The current-retry-vs-completed-parent rule further pins down selection.

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.