Skip to main content
Glama

elenchus_end_session

End a verification session by submitting a final verdict (PASS, FAIL, or CONDITIONAL) to close the adversarial analysis process.

Instructions

End the verification session with a final verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
verdictYesFinal verdict: must be exactly "PASS", "FAIL", or "CONDITIONAL"

Implementation Reference

  • Main handler function that ends a session: updates status to 'converged', computes summary (totalRounds, totalIssues, resolvedIssues, unresolvedIssues, issuesBySeverity), cleans up caches (session, mediator, role, pipeline state), and returns the result.
    export async function endSession(
      args: z.infer<typeof EndSessionSchema>
    ): Promise<{ sessionId: string; verdict: string; summary: object } | null> {
      const session = await getSession(args.sessionId);
      if (!session) return null;
    
      await updateSessionStatus(session.id, 'converged');
    
      const result = {
        sessionId: session.id,
        verdict: args.verdict,
        summary: {
          totalRounds: session.currentRound,
          totalIssues: session.issues.length,
          resolvedIssues: session.issues.filter(i => i.status === 'RESOLVED').length,
          unresolvedIssues: session.issues.filter(i => i.status !== 'RESOLVED').length,
          issuesBySeverity: getIssuesSummary(session).bySeverity
        }
      };
    
      // [FIX: REL-02] Clean up memory caches
      deleteSessionFromCache(session.id);
      deleteMediatorState(session.id);
      deleteRoleState(session.id);
      deletePipelineState(session.id);
    
      return result;
    }
  • Input schema for end_session tool: validates sessionId (string) and verdict (enum: PASS, FAIL, CONDITIONAL with custom error messaging).
    export const EndSessionSchema = z.object({
      sessionId: z.string().describe('Session ID'),
      verdict: VerdictEnum.describe('Final verdict: must be exactly "PASS", "FAIL", or "CONDITIONAL"')
    });
  • Output schema for end_session: returns sessionId, verdict, and summary with totalRounds, totalIssues, resolvedIssues, unresolvedIssues, issuesByCategory, issuesBySeverity.
    export const EndSessionOutputSchema = z.object({
      sessionId: z.string(),
      verdict: z.enum(['PASS', 'FAIL', 'CONDITIONAL']),
      summary: z.object({
        totalRounds: z.number(),
        totalIssues: z.number(),
        resolvedIssues: z.number(),
        unresolvedIssues: z.number(),
        issuesByCategory: z.record(z.number()),
        issuesBySeverity: z.record(z.number())
      })
    }).nullable();
  • Tool registration mapping the name 'elenchus_end_session' to its description, schema (EndSessionSchema), and handler (endSession).
      elenchus_end_session: {
        description: 'End the verification session with a final verdict.',
        schema: EndSessionSchema,
        handler: endSession
      }
    };
  • Re-export of the endSession handler from session-lifecycle, making it available for external consumers of the tools module.
    export { startSession, getContext, submitRound, endSession } from './session-lifecycle.js';
Behavior2/5

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

No annotations provided, so the description must disclose behavioral traits. It only says 'with a final verdict' but does not explain side effects, irreversibility, or what happens to the session after ending. Insufficient for a mutation tool.

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

Conciseness5/5

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

Single sentence, no redundant words, front-loaded with verb and resource. Efficient and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite simplicity, the description omits behavioral context and return value. With no output schema, it should clarify what the tool returns (e.g., success confirmation). Incomplete for a self-contained definition.

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 coverage is 100%, so baseline is 3. The description adds no extra meaning beyond the schema; parameters are sufficiently described in the schema itself.

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?

Description clearly states the verb 'End' and resource 'verification session', and specifies it requires a 'final verdict'. This distinguishes it from sibling tools like elenchus_start_session.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives, nor any prerequisites or conditions. The description only states the action, leaving the agent to infer usage context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jhlee0409/elenchus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server