Skip to main content
Glama

cross_repo_snapshot

Returns the confidence score and drift summary across all registered repositories, surfacing the weakest repo to identify risks in multi-service workflows.

Instructions

Returns the latest confidence score and drift summary across every repository registered in the user-level registry at ~/.veris/registry.json. Useful when a single logical workflow spans multiple services — e.g., a checkout flow that touches a frontend repo, an orders service, and a payments service. Surfaces the weakest-confidence repo in the fleet first so an oncall engineer or release manager knows where to look.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler method 'handleCrossRepoSnapshot' that executes the tool logic. It creates a CrossRepoRegistry instance and calls its snapshot() method, returning the results as text.
    private handleCrossRepoSnapshot() {
        const reg = new CrossRepoRegistry();
        return this.text(reg.snapshot());
    }
  • Input/output schema definition for the cross_repo_snapshot tool. Declares empty input schema (no parameters) and describes the output as confidence score and drift summary across registered repos.
    { name: "cross_repo_snapshot",
      description: "Returns the latest confidence score and drift summary across every repository registered in the user-level registry at ~/.veris/registry.json. Useful when a single logical workflow spans multiple services — e.g., a checkout flow that touches a frontend repo, an orders service, and a payments service. Surfaces the weakest-confidence repo in the fleet first so an oncall engineer or release manager knows where to look.",
      inputSchema: { type: "object", properties: {}, required: [] } },
  • Tool registration in the switch-case statement. Maps the string 'cross_repo_snapshot' to the handler method handleCrossRepoSnapshot.
    case "cross_repo_snapshot": return this.handleCrossRepoSnapshot();
  • The CrossRepoRegistry class that manages the user-level registry at ~/.veris/registry.json. The snapshot() method (lines 78-89) iterates over registered repos, loads each repo's VerisState SQLite DB, fetches the last run record, and returns the aggregated fleet view.
    export class CrossRepoRegistry {
        private file: string;
        private data: RegistryShape;
    
        constructor() {
            const dir = path.join(os.homedir(), '.veris');
            if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
            this.file = path.join(dir, 'registry.json');
            if (fs.existsSync(this.file)) {
                try {
                    this.data = JSON.parse(fs.readFileSync(this.file, 'utf8'));
                } catch {
                    this.data = { repos: [] };
                }
            } else {
                this.data = { repos: [] };
            }
        }
    
        public list(): RepoEntry[] {
            return [...this.data.repos];
        }
    
        public register(name: string, repoPath: string, tags?: string[]): RepoEntry {
            const abs = path.resolve(repoPath);
            const existing = this.data.repos.find(r => r.path === abs);
            if (existing) {
                existing.name = name;
                existing.tags = tags || existing.tags;
                this.persist();
                return existing;
            }
            const entry: RepoEntry = { name, path: abs, addedAt: new Date().toISOString(), tags };
            this.data.repos.push(entry);
            this.persist();
            return entry;
        }
    
        public unregister(nameOrPath: string): boolean {
            const before = this.data.repos.length;
            this.data.repos = this.data.repos.filter(r => r.name !== nameOrPath && r.path !== nameOrPath);
            if (this.data.repos.length !== before) {
                this.persist();
                return true;
            }
            return false;
        }
    
        /**
         * Reads the latest run from each registered repo's .veris/state.db.
         * Returns a confidence + drift snapshot across the fleet.
         */
        public snapshot(): Array<RepoEntry & { lastRun: RunRecord | null }> {
            return this.data.repos.map(repo => {
                try {
                    const state = new VerisState(repo.path);
                    const lastRun = state.lastRun();
                    state.close();
                    return { ...repo, lastRun };
                } catch {
                    return { ...repo, lastRun: null };
                }
            });
        }
    
        private persist(): void {
            fs.writeFileSync(this.file, JSON.stringify(this.data, null, 2), 'utf8');
        }
    }
  • Helper method 'lastRun()' on VerisState that queries the SQLite state.db for the most recent run record. Used by CrossRepoRegistry.snapshot() to retrieve per-repo confidence and drift data.
    public lastRun(): RunRecord | null {
        if (!this.db) return null;
        const row = this.db.prepare(`
            SELECT run_id as runId, ts, diff_mode as diffMode, base_ref as baseRef, head_ref as headRef,
                   overall_confidence as overallConfidence, execution_depth as executionDepth,
                   nodes, edges, workflows, impacted_nodes as impactedNodes
            FROM runs ORDER BY ts DESC LIMIT 1
        `).get() as RunRecord | undefined;
        return row || null;
    }
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool reads from ~/.veris/registry.json and implies a non-destructive read operation. It does not mention authorization or rate limits, but for a simple read tool this is acceptable.

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 concise at 4 sentences, front-loaded with the core purpose. Every sentence adds value: the return type, the use case, the output ordering, and the target audience.

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

Completeness5/5

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

Given no parameters and no output schema, the description is complete. It explains what is returned and in what order, and provides a relevant use case. No further information is necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, so the description cannot add parameter meaning. Baseline 4 applies as no additional clarification is needed.

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 returns 'latest confidence score and drift summary across every repository registered in the user-level registry'. The verb 'returns' and specific resources are well-defined, and it distinguishes itself from siblings by focusing on cross-repo aggregation.

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

Usage Guidelines4/5

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

The description provides a clear use case: 'when a single logical workflow spans multiple services' with an example. It also notes the output ordering (weakest-confidence first) to guide the user. However, it does not explicitly state when not to use this tool.

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/vighriday/Veris'

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