Skip to main content
Glama

emet_session_close

Verifies that a session's work is saved before ending it by checking receipts against the store and reporting missing items; use when wrapping up or closing a session.

Instructions

Call this when the session is ending - the user says goodbye, asks you to wrap up, mentions restarting or opening a new session, or you are about to run out of room. An acknowledgement of the turn just completed - thanks, great, perfect - is not a session end; if it is ambiguous, ask rather than close. Checks whether this session's work has actually been written to the store and reports exactly what is missing. It does not write anything itself. RECEIPTS ARE REQUIRED: pass receipts naming what you wrote and read back for each close step - working documents, the episodic session record id, the board and its version, the transcript part ids and highest exchange index as query_transcripts returned them, and the handoff version (written last). Each receipt is compared with the store; omitted or mismatched receipts, a handoff that was not the last write, or a transcript no layer entry cites (derived_from) return state 'blocked'. Each missing line carries a scope: touch only what it names. THREE blocked closes on one session return state 'escalate': stop retrying, say the speak lines, and hand the user the list - the counter does not reset on a changed receipt, only with a new session. Say every line of the returned speak to the user, in order - a wrap that leaves it out is a failed close. A records/ session disposition is not a receipt and does not make this call complete. Pass carry_forward only for an old open session whose HANDOFF and STATE a later session already advanced. The owner door, or the credential that wrote the session, cites the current conforming records/ disposition (CARRIED_FORWARD, SUPERSEDED_BY_LATER_SESSION, or ABANDONED_NO_TRANSCRIPT) and those later versions. RETAINED_OPEN_CRITICAL stays open. A declared source is not authority. Transcripts are not deleted. A refused carry_forward is not counted. A receipt close blocked only because a later session holds HANDOFF or STATE stays blocked and is not counted. A same-session close is unchanged. Never tell the user their session is saved unless this returns state 'complete'.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "emet_session_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceNoYour host's source tag: the registered tag this session was written under. The close is never refused for it; an unregistered tag, one that did not write this session, or none (with no server default) gets a warning that the close is not attributed.
exchangeNoThe exchange (turn) this write belongs to, counting from 1. A write for exchange n while exchange n-1 was never appended is refused by the session graph until n-1 is appended.
receiptsNoRequired for state 'complete'. One entry per close step, taken from what the tools returned this session - not from recall.
session_idNoThe session_id used (or to be used) for this session's transcript, e.g. '2026-09-03_short-description'. Without it the transcript cannot be checked; receipts.transcript_session_id is used when this is omitted.
thread_docsNoAdditional document ids this session should have updated, e.g. ['threads/some-project.md'].
carry_forwardNoDisposition-backed close for an old open session. Omit it for a normal receipt close. Not a receipt, and not authority by itself.
session_startNoUnix seconds when the session began. Defaults to 12 hours ago, which makes the answer approximate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.3
    • addedInput schema / properties / carry_forward
      Added value: +{
      +  "description": "Disposition-backed close for an old open session. Omit it for a normal receipt close. Not a receipt, and not authority by itself.",
      +  "properties": {
      +    "citations": {
      +      "description": "Later continuity records that superseded this session's receipts. A host session cites the current HANDOFF and STATE versions. A bot session cites its own handoff.",
      +      "items": {
      +        "properties": {
      +          "doc_id": {
      +            "type": "string"
      +          },
      +          "version": {
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "disposition_doc": {
      +      "description": "records/ document id of the current conforming session disposition.",
      +      "type": "string"
      +    },
      +    "disposition_version": {
      +      "description": "Version of that document now in force.",
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv0.2.2
    • changedInput schema / properties / exchange / description
      Previous value: -"The exchange (turn) this write belongs to, counting from 1. A write for exchange n while exchange n-1 was never appended is flagged by the session graph."New value: +"The exchange (turn) this write belongs to, counting from 1. A write for exchange n while exchange n-1 was never appended is refused by the session graph until n-1 is appended."
    • addedInput schema / properties / source
      Added value: +{
      +  "description": "Your host's source tag: the registered tag this session was written under. The close is never refused for it; an unregistered tag, one that did not write this session, or none (with no server default) gets a warning that the close is not attributed.",
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: describes the compare-with-store receipt mechanism, the 'blocked' state with per-line `scope`, the escalate-after-three rule including that the counter survives a changed receipt but resets with a new session, and that certain refusals are not counted. Annotations give only readOnlyHint=false and destructiveHint=false; the description supplies the entire state machine and the mandatory `speak` output protocol.

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 trigger is correctly front-loaded, but the body is a dense wall of short declarative fragments ('A declared source is not authority.', 'A same-session close is unchanged.') that require re-reading and lack grouping into rules for receipts, blocked states, and carry_forward. Most sentences carry information, but the packing makes it harder to act on than its length alone would suggest.

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?

There is no output schema, and the description partially compensates by naming the return states ('complete', 'blocked', 'escalate'), the `speak` lines, and the per-line `scope`. For a 7-parameter nested-schema tool, a fuller enumeration of the response shape (e.g. what a 'complete' payload contains) would close the remaining gap.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning: receipts must be taken from what the tools returned this session rather than recall, the handoff must be the last write, transcript parts and exchange index must match query_transcripts, and carry_forward is only for old open sessions. It does not detail every field (e.g. thread_docs, session_start beyond the schema text), so it stops short of 5.

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: it checks whether the session's work was actually written to the store and reports what is missing. It explicitly disclaims the sibling behavior an agent might otherwise assume ('It does not write anything itself'), which separates it from save_to_layer, save_transcript, and write_doc_commit.

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?

Names concrete triggering events (user says goodbye, asks to wrap up, mentions restarting or a new session, or context is running out) and an explicit exclusion ('An acknowledgement of the turn just completed - thanks, great, perfect - is not a session end'), plus a tie-breaker: ask if ambiguous. It also scopes carry_forward to only old open sessions already advanced by a later session.

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