Skip to main content
Glama

elenchus_check_convergence_allowed

Check if session convergence is allowed by evaluating quality safeguards, with an optional strict mode for tighter requirements.

Instructions

Check if session convergence is allowed based on quality safeguards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
strictModeNoUse strict quality requirements

Implementation Reference

  • The main handler function for the 'elenchus_check_convergence_allowed' tool. It calls shouldAllowConvergence() from the safeguards module and returns a result with allowed status, blockers list, quality score, and a message.
    /**
     * Check if convergence is allowed based on quality safeguards
     */
    export async function checkConvergenceAllowedTool(
      args: z.infer<typeof CheckConvergenceAllowedSchema>
    ): Promise<{
      allowed: boolean;
      blockers: string[];
      qualityScore?: number;
      message: string;
    }> {
      const result = shouldAllowConvergence(args.sessionId, args.strictMode);
      const state = getSafeguardsState(args.sessionId);
    
      return {
        allowed: result.allow,
        blockers: result.blockers,
        qualityScore: state?.quality.score,
        message: result.allow
          ? 'Convergence allowed - quality safeguards passed'
          : `Convergence blocked: ${result.blockers.join(', ')}`
      };
    }
  • Input schema for the 'elenchus_check_convergence_allowed' tool. Defines sessionId (required string) and strictMode (optional boolean, default false).
    export const CheckConvergenceAllowedSchema = z.object({
      sessionId: z.string().describe('Session ID'),
      strictMode: z.boolean().optional().default(false).describe('Use strict quality requirements')
    });
  • Registration of the tool in the safeguardsTools object, mapping the tool name 'elenchus_check_convergence_allowed' to its description, schema, and handler.
      elenchus_check_convergence_allowed: {
        description: 'Check if session convergence is allowed based on quality safeguards.',
        schema: CheckConvergenceAllowedSchema,
        handler: checkConvergenceAllowedTool
      }
    };
  • Core helper function 'shouldAllowConvergence' that evaluates whether convergence should be allowed. In strict mode, blocks on POOR/UNACCEPTABLE quality or low confidence. In normal mode, blocks only on UNACCEPTABLE quality or ERROR-level concerns.
    /**
     * Should session be allowed to converge?
     */
    export function shouldAllowConvergence(
      sessionId: string,
      strictMode: boolean = false
    ): { allow: boolean; blockers: string[] } {
      const state = safeguardsStates.get(sessionId);
      if (!state) return { allow: true, blockers: [] };
    
      const blockers: string[] = [];
    
      if (strictMode) {
        // Strict mode: block on any concern
        if (state.quality.level === 'POOR' || state.quality.level === 'UNACCEPTABLE') {
          blockers.push(`Quality level ${state.quality.level} is too low`);
        }
    
        if (state.quality.metrics.confidence < state.confidence.config.minimumAcceptable) {
          blockers.push(`Confidence ${Math.round(state.quality.metrics.confidence * 100)}% below threshold`);
        }
      } else {
        // Normal mode: block only on critical issues
        if (state.quality.level === 'UNACCEPTABLE') {
          blockers.push(`Quality level UNACCEPTABLE`);
        }
    
        // Check for critical concerns
        const criticalConcerns = state.quality.concerns.filter(c => c.severity === 'ERROR');
        for (const concern of criticalConcerns) {
          blockers.push(concern.message);
        }
      }
    
      return { allow: blockers.length === 0, blockers };
    }
  • Top-level tool registration in the composed 'tools' object which spreads all safeguardsTools (including elenchus_check_convergence_allowed) into the final MCP tool registry.
    export const tools = {
      ...sessionLifecycleTools,
      ...issueManagementTools,
      ...mediatorTools,
      ...roleTools,
      ...reverifyTools,
      ...diffTools,
      ...cacheTools,
      ...pipelineTools,
      ...safeguardsTools,
      ...optimizationTools,
      ...dynamicRoleTools,
      ...llmEvalTools,
    };
Behavior2/5

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

No annotations are provided, and the description does not disclose key behaviors beyond a vague reference to 'quality safeguards'. It does not state whether the tool is read-only, what triggers a denial, or any side effects.

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?

The description is a single, front-loaded sentence with no redundant information. It efficiently conveys the tool's purpose.

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

Completeness3/5

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

Given no output schema, the description lacks detail on return values. For a simple check tool, it might be considered adequate, but it does not explain what 'allowed' means or what the boolean response indicates.

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 parameters are fully defined. The description adds minimal value beyond the schema, only mentioning 'quality safeguards' without linking to parameters. Baseline 3 is appropriate.

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 clearly states the tool checks if session convergence is allowed based on quality safeguards. It uses a specific verb ('Check') and resource, and distinguishes from siblings like 'elenchus_evaluate_convergence' which likely performs a different evaluation.

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 guidance is provided on when to use this tool versus alternatives, such as 'elenchus_evaluate_convergence' or other safeguard-related tools. The description does not include conditions, prerequisites, or exclusions.

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