converge_query
Send a query to multiple LLMs simultaneously, perform consensus validation, and receive a structured result with agreement metrics and provenance.
Instructions
Fan out a query to multiple LLMs in parallel (OpenAI, Claude, Gemini, Ollama), run multi-stage consensus validation, and return a structured result with agreement score, truth stability classification, and provenance. NEVER rely on one model answer. Friction between disagreements = intelligence.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query to fan out to multiple models | |
| models | No | List of model names to query. E.g. ["gpt-4o", "claude-3-5-sonnet-20241022", "gemini-1.5-pro"]. Leave empty for defaults. | |
| policy_set | No | Optional policy set identifier for compliance filtering (e.g. "hipaa", "eu-ai-act") |
Implementation Reference
- src/index.ts:153-170 (handler)The tool 'converge_query' handler in the CallToolRequestSchema handler. It validates inputs with Zod schema, calls convergeQuery from client.ts, and returns the JSON result.
case 'converge_query': { const schema = z.object({ query: z.string().min(1), models: z.array(z.string()).default([]), policy_set: z.string().optional(), }); const params = schema.parse(args); const result = await convergeQuery(params.query, params.models, params.policy_set); return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2), }, ], }; } - src/index.ts:59-85 (registration)Tool registration for 'converge_query' with name, description, and input schema (query, models, policy_set) as part of ListToolsRequestSchema.
name: 'converge_query', description: 'Fan out a query to multiple LLMs in parallel (OpenAI, Claude, Gemini, Ollama), run multi-stage consensus validation, and return a structured result with agreement score, truth stability classification, and provenance. ' + 'NEVER rely on one model answer. Friction between disagreements = intelligence.', inputSchema: { type: 'object' as const, required: ['query'], properties: { query: { type: 'string', description: 'The query to fan out to multiple models', }, models: { type: 'array', items: { type: 'string' }, description: 'List of model names to query. E.g. ["gpt-4o", "claude-3-5-sonnet-20241022", "gemini-1.5-pro"]. Leave empty for defaults.', default: [], }, policy_set: { type: 'string', description: 'Optional policy set identifier for compliance filtering (e.g. "hipaa", "eu-ai-act")', }, }, }, }, - src/lib/client.ts:101-111 (helper)The convergeQuery function implementation - an HTTP client that POSTs query, models, and policy_set to the convergence service endpoint and returns a ConvergeResult.
export async function convergeQuery( query: string, models: string[], policySet?: string ): Promise<ConvergeResult> { return post<ConvergeResult>(`${CONVERGENCE_SERVICE_URL}/converge`, { query, models, policy_set: policySet, }); } - src/lib/client.ts:48-65 (schema)The ConvergeResult interface defining the return type of convergeQuery: run_id, status, query, models_used, consensus, final_answer, etc.
export interface ConvergeResult { run_id: string; status: string; query: string; models_used: Array<{ model: string; provider: string; latency_ms: number; error?: string }>; successful_models: number; failed_models: number; consensus: { analysis_id: string; agreement_score: number; stability: string; agreed_claims: string[]; disputed_claims: string[]; inversion_count: number; } | null; final_answer: string; evidence_ladder_url: string; } - src/index.ts:154-158 (schema)Zod input validation schema for converge_query: query (required string), models (optional array of strings, default []), policy_set (optional string).
const schema = z.object({ query: z.string().min(1), models: z.array(z.string()).default([]), policy_set: z.string().optional(), });