Home / Function/ renderOverview() — mcp Function Reference

renderOverview() — mcp Function Reference

Architecture documentation for the renderOverview() function in overview.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  82b72c82_f107_1ece_5ba4_a66ed36389be["renderOverview()"]
  6cc13fa0_0ce9_926f_417f_6b3f50082f67["injectOverviewInstructions()"]
  6cc13fa0_0ce9_926f_417f_6b3f50082f67 -->|calls| 82b72c82_f107_1ece_5ba4_a66ed36389be
  a98010dc_5359_1091_7b2a_e4dcbe99164c["handler()"]
  a98010dc_5359_1091_7b2a_e4dcbe99164c -->|calls| 82b72c82_f107_1ece_5ba4_a66ed36389be
  fbeba3a0_8168_dd12_bca3_885bafcb50b5["getKeyFilesForDomain()"]
  82b72c82_f107_1ece_5ba4_a66ed36389be -->|calls| fbeba3a0_8168_dd12_bca3_885bafcb50b5
  55bde18a_7860_173e_f211_5874970475e3["get()"]
  82b72c82_f107_1ece_5ba4_a66ed36389be -->|calls| 55bde18a_7860_173e_f211_5874970475e3
  907aa672_168a_bb3a_80dd_ab8d5314cfb2["truncate()"]
  82b72c82_f107_1ece_5ba4_a66ed36389be -->|calls| 907aa672_168a_bb3a_80dd_ab8d5314cfb2
  7447e270_7494_99ba_d664_188091d75987["getHubFunctions()"]
  82b72c82_f107_1ece_5ba4_a66ed36389be -->|calls| 7447e270_7494_99ba_d664_188091d75987
  style 82b72c82_f107_1ece_5ba4_a66ed36389be fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/tools/overview.ts lines 74–133

export function renderOverview(graph: IndexedGraph): string {
  const s = graph.summary;
  const lines: string[] = [];

  // Header
  const repoName = graph.raw.repo ? `Repository ${graph.raw.repo.substring(0, 8)}` : 'Codebase';
  lines.push(
    `# ${repoName} (${s.filesProcessed} files, ${s.functions} functions, ${s.classes} classes)`
  );
  lines.push(`**Language:** ${s.primaryLanguage} | **Nodes:** ${s.nodeCount} | **Relationships:** ${s.relationshipCount}`);
  lines.push('');

  // Domains
  if (graph.domainIndex.size > 0) {
    lines.push('## Architecture Domains');
    lines.push('');

    // Sort domains by member count (descending)
    const domains = [...graph.domainIndex.entries()]
      .map(([name, data]) => ({ name, memberCount: data.memberIds.length, memberIds: data.memberIds }))
      .sort((a, b) => b.memberCount - a.memberCount)
      .slice(0, MAX_OVERVIEW_DOMAINS);

    for (const domain of domains) {
      // Get key files for this domain
      const keyFiles = getKeyFilesForDomain(graph, domain.memberIds);
      const filesStr = keyFiles.length > 0
        ? `\n  Key files: ${keyFiles.join(', ')}`
        : '';

      // Get the domain node description
      const domainNodes = graph.nameIndex.get(domain.name.toLowerCase()) || [];
      let desc = '';
      for (const nid of domainNodes) {
        const node = graph.nodeById.get(nid);
        if (node?.labels?.[0] === 'Domain') {
          desc = (node.properties?.description as string) || '';
          break;
        }
      }
      const descStr = desc ? `: ${truncate(desc, 80)}` : '';

      lines.push(`- **${domain.name}** (${domain.memberCount} members)${descStr}${filesStr}`);
    }
    lines.push('');
  }

  // Hub functions (most called)
  const hubs = getHubFunctions(graph, MAX_OVERVIEW_HUB_FUNCTIONS);
  if (hubs.length > 0) {
    lines.push('## Most-Called Functions');
    lines.push('');
    for (const hub of hubs) {
      lines.push(`- \`${hub.name}\` (${hub.callerCount} callers) — ${hub.filePath}:${hub.line}`);
    }
    lines.push('');
  }

  return lines.join('\n');
}

Domain

Subdomains

Frequently Asked Questions

What does renderOverview() do?
renderOverview() is a function in the mcp codebase.
What does renderOverview() call?
renderOverview() calls 4 function(s): get, getHubFunctions, getKeyFilesForDomain, truncate.
What calls renderOverview()?
renderOverview() is called by 2 function(s): handler, injectOverviewInstructions.

Analyze Your Own Codebase

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

Try Supermodel Free