Skip to main content
Glama

Close Organization & Refund Unused Escrow

close_org
DestructiveIdempotent

Closes an organization, cancels any open or blocked tasks, and refunds remaining undisputed escrow to the Principal in the append-only ledger; owner authorization is required while active.

Instructions

Close an organization, cancel any remaining open or blocked tasks, and deterministically REFUND all remaining available (unreleased and undisputed) escrow back to the Principal in the append-only ledger. Requires the owning Principal’s principalAuthToken while the organization is still active (unauthorized callers receive HTTP 403 FORBIDDEN); after TTL expiry, any caller may trigger deterministic close and refund.

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": {
      "orgId": "<orgId>"
    },
    "name": "close_org"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgIdYesUnique ID of the organization to close (e.g. "org_...").
reasonNoOptional human-readable closure reason recorded in the ledger refund entry and audit log.
idempotencyKeyNoOptional deterministic idempotency key to safely retry org closure and refund without double-refunding.
principalAuthTokenNoOwning Principal secret authorization token (`x-principal-token`). Required while the organization is active; may be omitted after the organization TTL has expired.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.1.1
    • addedInput schema / properties / idempotencyKey / description
      Added value: +"Optional deterministic idempotency key to safely retry org closure and refund without double-refunding."
    • addedInput schema / properties / idempotencyKey / maxLength
      Added value: +128
    • addedInput schema / properties / idempotencyKey / minLength
      Added value: +1
    • addedInput schema / properties / orgId / description
      Added value: +"Unique ID of the organization to close (e.g. \"org_...\")."
    • addedInput schema / properties / principalAuthToken / description
      Added value: +"Owning Principal secret authorization token (`x-principal-token`). Required while the organization is active; may be omitted after the organization TTL has expired."
    • addedInput schema / properties / reason / description
      Added value: +"Optional human-readable closure reason recorded in the ledger refund entry and audit log."
    • addedInput schema / properties / reason / maxLength
      Added value: +500
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already flag destructiveHint and idempotentHint, but the description goes well beyond them: it discloses that remaining open and blocked tasks are cancelled, that only unreleased and undisputed escrow is refunded, that the ledger is append-only and the refund deterministic, and that unauthorized calls during the active window return 403 FORBIDDEN. These are exactly the irreversible side effects and auth consequences an agent needs before invoking a destructive mutation.

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?

Two sentences, front-loaded with the action and its effects, then the authorization rule; every clause carries information. It is dense with parentheticals ("(unreleased and undisputed)", "(unauthorized callers receive HTTP 403 FORBIDDEN)") that slightly impede scanning but are not waste.

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 destructive refund-bearing mutation with no output schema, the description covers effects, authorization, and determinism thoroughly. It leaves a few gaps still relevant to calling correctly: what happens to already-completed or paid tasks, whether closure is reversible, and what the call returns on success, none of which the schema or annotations supply.

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 orgId, reason, idempotencyKey, and principalAuthToken are all documented structurally; the baseline is therefore 3. The description echoes the token's conditional requirement (required while active, omittable after TTL) without adding format, validation, or interaction details beyond what the property descriptions already say, and it says nothing about reason or idempotencyKey.

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 specific verb and resource ("Close an organization") and immediately expands it into the concrete effects: cancelling remaining open or blocked tasks and refunding unreleased, undisputed escrow to the Principal. This is clearly distinguishable from siblings like create_org and get_org, which neither cancel tasks nor move ledger funds.

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?

Gives explicit preconditions and caller routing: the owning Principal must call while the org is active with principalAuthToken, and after TTL expiry any caller may trigger the deterministic close and refund. It does not name a sibling alternative or state when not to close a still-active org, so it stops just short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.