Home / Function/ injectOverviewInstructions() — mcp Function Reference

injectOverviewInstructions() — mcp Function Reference

Architecture documentation for the injectOverviewInstructions() function in server.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  1f1e3342_1a9b_64a4_0615_96437ddf8cb2["injectOverviewInstructions()"]
  a9363f44_0cfc_87dc_a76a_4eeb9d75c684["start()"]
  a9363f44_0cfc_87dc_a76a_4eeb9d75c684 -->|calls| 1f1e3342_1a9b_64a4_0615_96437ddf8cb2
  6e09a07b_b4e3_8cd3_f98b_18ee50725d44["getTestHint()"]
  1f1e3342_1a9b_64a4_0615_96437ddf8cb2 -->|calls| 6e09a07b_b4e3_8cd3_f98b_18ee50725d44
  d8e22e5c_06d6_3c1a_d1ff_f9f562d53e5d["renderOverview()"]
  1f1e3342_1a9b_64a4_0615_96437ddf8cb2 -->|calls| d8e22e5c_06d6_3c1a_d1ff_f9f562d53e5d
  69fc7a46_28f6_6b72_2725_66c381e53322["debug()"]
  1f1e3342_1a9b_64a4_0615_96437ddf8cb2 -->|calls| 69fc7a46_28f6_6b72_2725_66c381e53322
  e5352615_c5fb_64a2_cc5c_a248578cbc8a["warn()"]
  1f1e3342_1a9b_64a4_0615_96437ddf8cb2 -->|calls| e5352615_c5fb_64a2_cc5c_a248578cbc8a
  style 1f1e3342_1a9b_64a4_0615_96437ddf8cb2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/server.ts lines 213–233

  private injectOverviewInstructions(repoMap: Map<string, import('./cache/graph-cache').IndexedGraph>) {
    if (repoMap.size === 0) return;

    // Skip overview injection during experiments to isolate variables (except graphrag)
    if (process.env.SUPERMODEL_EXPERIMENT && process.env.SUPERMODEL_EXPERIMENT !== 'graphrag') return;

    // Only inject if there's exactly 1 unique graph (SWE-bench always has exactly 1 repo)
    const uniqueGraphs = new Set([...repoMap.values()]);
    if (uniqueGraphs.size !== 1) return;

    const graph = [...uniqueGraphs][0];
    try {
      const overview = renderOverview(graph);
      const testHint = this.getTestHint(graph.summary.primaryLanguage);
      const current = (this.server.server as any)._instructions as string | undefined;
      (this.server.server as any)._instructions = (current || '') + '\n\n' + overview + testHint;
      logger.debug('Injected overview into server instructions');
    } catch (err: any) {
      logger.warn('Failed to render overview for instructions:', err.message || err);
    }
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does injectOverviewInstructions() do?
injectOverviewInstructions() is a function in the mcp codebase.
What does injectOverviewInstructions() call?
injectOverviewInstructions() calls 4 function(s): debug, getTestHint, renderOverview, warn.
What calls injectOverviewInstructions()?
injectOverviewInstructions() is called by 1 function(s): start.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free