Skip to main content
Glama

Advanced: seal a session

runtime_session_close
DestructiveIdempotent

Seal a raw session so further exec or policy calls on its session ID are rejected; use when the user asks to close the session.

Instructions

[advanced/internal] Seal a raw session so further exec or policy on that session_id is rejected. End of the raw lifecycle — not a LOCKSET seal and not a FragGate call. Use this when the user asked to close the session. Do not use it for ordinary completion, writing a ChainLock LOCKSET, or default product work; use leaving the session to TTL expire (6h), chainlock_seal for a lockset, or fraggate_call for new work instead. Destructive to further exec/policy on that session_id only (session_closed 409). Does not delete receipts. A second close does not reopen — it returns session_closed (409) while the session stays sealed. Missing session returns session_not_found. Prefer leaving sessions to expire unless asked. session_id or id (aliases) required. No force flag on the public tool — TTL expiry is the automatic close path. Mutation requires confirm=true (runtime gate) or dry_run=true (preview only, no write). confirm and dry_run stay optional on inputSchema.required. dry_run still returns FG-HALLUC-TOOL, FG-STUB, FG-UNKNOWN-OP, or FG-LOCAL-ONLY when a confirm call would refuse. confirm is consent, not tenant auth, and it does not upgrade shared public-demo isolation. Returns sealed session status, close receipt, and verified.

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": {
      "session_id": "<session_id>"
    },
    "name": "runtime_session_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoAlias of session_id. The door accepts either key; do not send two different values.
confirmNoDocumented confirmation flag. Optional in inputSchema.required (connector refresh must not break). tools/call still refuses MCP-CONFIRM-REQUIRED when confirm is missing or false unless dry_run=true. confirm is consent to run the call. It is not tenant auth and it does not upgrade shared public-demo isolation.
dry_runNoOptional preview flag. When true, do not write and do not stamp a ledger tip. Allowlist, hallucination, stub, and local-only checks still run and return the same FragGate refuse code a confirm call would get. MCP-DRY-RUN is returned only when that call would have been allowed to proceed. confirm is consent, not tenant auth, and it does not upgrade shared public-demo isolation.
session_idYesRequired. Raw session id from runtime_session_open (sess_ + 32 lowercase hex). Alias: id. Missing both fails with session_id required; unknown id returns session_not_found.

Output Schema

NameRequiredDescriptionDefault
codeNoFragGate or fabric code when present: FG-OK, FG-HALLUC-TOOL, FG-STUB, FG-LOCAL-ONLY, FG-UNKNOWN-OP, FG-GATE-REFUSE, FG-LAMB-REFUSE, or a module refuse such as MESH-* / AKM-*.
doorNoDoor name. The public door is fraggate.
ran_inNoExecution locale (for example aziel-runtime) when present.
resultNoClose body: sealed session, close receipt, verified. Errors: session_id required, session_not_found, session_closed (already sealed; does not reopen).
statusNoHTTP-like status when present on wrappers (200 ok; 400+ error / refuse).
displayNoHuman-facing envelope. Show display.action, title, and summary, then take the next input. Never echo raw tool names.
receiptNoOptional receipt, ledger tip, or TemporalLock/ForgeReceipts exit when the door stamped one.
refusalNoExplicit refuse object, code, or message when the door or engine refused.
engine_opNoResolved engine op when present (often inside result).
ledger_tipNoAsk/refuse ledger tip when the door stamped one.
provenanceNoProvenance / input packet when the pipeline attached one.
session_idNoRaw session id when session plumbing was used. Hidden unless the user asked for the chain.
engine_slugNoResolved engine slug when present (often inside result).
limitationsNoCapability limitations or Remain-OFF notes when present.
engine_digestNo64-hex engine_digest when a true in-process engine ran (often inside result).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already signal destructive/idempotent behavior, and the description adds substantial context: destructive scope is limited to further exec/policy, receipts are not deleted, a second close returns session_closed (409), missing sessions return session_not_found, and dry_run behavior is detailed. This goes well beyond the annotation signals without contradicting them.

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?

The description is long but well organized and front-loaded with the core action and exclusions. It earns most sentences, though it partially repeats confirm/dry_run semantics already present in the input schema, which adds slight redundancy.

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?

For a destructive, advanced internal tool, the description covers error cases, scope of effect, mutation requirements, no-force behavior, alternatives, and what the call returns. An output schema exists, so return-value details do not need to be duplicated in text.

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 the schema already documents each parameter. The description still adds useful semantics: session_id/id alias handling, no force flag on the public tool, confirm/dry_run optionality on the required list, and the meaning of confirm as consent rather than tenant auth.

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: 'Seal a raw session so further exec or policy on that session_id is rejected.' It also explicitly distinguishes itself from sibling tools ('not a LOCKSET seal and not a FragGate call'), making it immediately clear which operation this is.

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 gives explicit when-to-use guidance ('Use this when the user asked to close the session') and when-not-to-use guidance with named alternatives: 'use leaving the session to TTL expire (6h), chainlock_seal for a lockset, or fraggate_call for new work instead.' This fully routes the agent to the correct tool.

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