elenchus_mediator_summary
Retrieve a mediator summary for a session, providing dependency graph statistics, verification coverage, and intervention history to assess code verification progress.
Instructions
Get mediator summary including dependency graph stats, verification coverage, and intervention history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID |
Implementation Reference
- src/mediator/index.ts:999-1027 (handler)The core handler function `getMediatorSummary` that executes the tool logic. It retrieves the mediator state for a session and returns a summary object containing graph stats (nodes, edges, circular deps), coverage stats (total/verified files, rate, unverified critical), and intervention stats (total, by type, last intervention).
export function getMediatorSummary(sessionId: string): object | null { const state = mediatorStates.get(sessionId); if (!state) return null; const totalInterventions = state.interventions.length; const byType = new Map<ActiveInterventionType, number>(); for (const i of state.interventions) { byType.set(i.type, (byType.get(i.type) || 0) + 1); } return { graphStats: { totalNodes: state.graph.nodes.size, totalEdges: state.graph.edges.length, circularDeps: detectCircularDependencies(state.graph).length }, coverage: { totalFiles: state.coverage.totalFiles, verifiedFiles: state.coverage.verifiedFiles.size, coverageRate: (state.coverage.verifiedFiles.size / state.coverage.totalFiles * 100).toFixed(1) + '%', unverifiedCritical: state.coverage.unverifiedCritical.length }, interventions: { total: totalInterventions, byType: Object.fromEntries(byType), lastIntervention: state.interventions[state.interventions.length - 1] || null } }; } - src/tools/mediator-tools.ts:43-47 (handler)The exported `mediatorSummary` async function that acts as the MCP tool handler. It receives the validated args (sessionId), delegates to `getMediatorSummary` from the mediator module, and returns the result.
export async function mediatorSummary( args: z.infer<typeof MediatorSummarySchema> ): Promise<object | null> { return getMediatorSummary(args.sessionId); } - src/tools/schemas.ts:201-203 (schema)The Zod schema `MediatorSummarySchema` for input validation. It defines a single required field: `sessionId` (string).
export const MediatorSummarySchema = z.object({ sessionId: z.string().describe('Session ID') }); - src/tools/mediator-tools.ts:59-63 (registration)The tool registration entry. The object `elenchus_mediator_summary` is defined in `mediatorTools` with a description, schema, and handler reference, and is later spread into the global `tools` export in src/tools/index.ts.
elenchus_mediator_summary: { description: 'Get mediator summary including dependency graph stats, verification coverage, and intervention history.', schema: MediatorSummarySchema, handler: mediatorSummary }