Skip to main content
Glama

Finalize Session

session_finalize
Idempotent

Abort an unfinished cross-review session with an optional reason. Verifies the caller's identity so only the authenticated petitioner can finalize the outcome.

Instructions

Close a non-terminal durable session as aborted with an optional reason of at most 200 characters. Requires the verified capability token of the persisted session petitioner: the peer host must pass caller explicitly as its own identity, and a caller that contradicts that host's own token or clientInfo is refused as identity forgery. converged is sealed only by the runtime, when the petitioner and every required peer are READY and every evidence gate passes; max-rounds is written only by the runtime or the idle sweep.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callerYes
reasonNo
outcomeYes
session_idYes
response_formatNojson

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.4.18
    • removedInput schema / properties / caller / default
      Removed value: -"operator"
    • changedInput schema / properties / caller / enum
      Previous value: -[
      -  "codex",
      -  "claude",
      -  "gemini",
      -  "deepseek",
      -  "grok",
      -  "perplexity",
      -  "operator"
      -]New value: +[
      +  "codex",
      +  "claude",
      +  "gemini",
      +  "deepseek",
      +  "grok",
      +  "perplexity"
      +]
    • changedInput schema / properties / outcome / enum
      Previous value: -[
      -  "converged",
      -  "aborted",
      -  "max-rounds"
      -]New value: +[
      +  "aborted"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "session_id",
      -  "outcome"
      -]New value: +[
      +  "session_id",
      +  "outcome",
      +  "caller"
      +]
  2. Addedv4.4.12
  3. Removedv4.4.11
  4. First observedv4.4.8

TDQS

A3.9/5.0
Behavior5/5

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

The description goes beyond annotations by disclosing the identity forgery check, requiring the caller to match the peer host's token/clientInfo, and stating that the 'converged' outcome is only sealed by the runtime. It also notes the max characters for reason and that 'max-rounds' is only written by runtime/sweep. These are significant behavioral traits not present in the annotations (which only provide idempotentHint/destructiveHint). There is no contradiction with annotations.

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 dense but appropriately sized for the complexity, covering the core purpose first, then auth requirements, then runtime constraints. The sentences are structured logically, front-loading the primary action. It could be slightly more concise by cutting the last clause about 'max-rounds-sweep', which is tangential, but it's acceptable.

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?

Given the tool's complexity (auth checks, runtime-only outcomes, limited outcomes), the description covers the essential use case and constraints. It lacks explicit mention of return values (no output schema, so description could mention what is returned, e.g., confirmation or error details), and it doesn't explain what happens if the session is already terminal. However, most critical decision-making info is present.

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 0%, so the description must explain parameters, and it does partially. It explains 'reason' (optional, max 200 chars) and 'caller' (must be host's own identity, forgery check), but does not explain 'session_id' format (though schema has pattern) or 'response_format' (schema has default). It doesn't add much beyond the schema for session_id, but for caller it adds crucial semantics. With 0% coverage, description should carry more, but it covers the most important behavioral parameter.

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 description clearly states that the tool closes a non-terminal durable session as 'aborted' with an optional reason, which is a specific action on a specific resource. It does not explicitly differentiate from siblings, but the outcome enum (only 'aborted') and the mention of 'non-terminal' make its purpose distinct, though not explicitly naming alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some context on when to use it: it's for aborted sessions, and it explains that 'converged' is only sealed by the runtime, not by this tool. However, it doesn't explicitly say 'use this instead of session_cancel_job' or similar, and doesn't mention when-not-to-use it (e.g., if the session is already terminal). The guidance is implied through the outcome constraint but not explicit.

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