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
  aea9c930_f1b1_d4dc_72c2_803aeb181aad["renderOverview()"]
  242ec636_ba33_547c_5cb6_5f619c73d099["overview.ts"]
  aea9c930_f1b1_d4dc_72c2_803aeb181aad -->|defined in| 242ec636_ba33_547c_5cb6_5f619c73d099
  b0737d71_130b_01b2_dbd7_14cb5f04946b["handler()"]
  b0737d71_130b_01b2_dbd7_14cb5f04946b -->|calls| aea9c930_f1b1_d4dc_72c2_803aeb181aad
  88e2bfd3_c9cd_c8ac_4c2b_2911435fbb08["getKeyFilesForDomain()"]
  aea9c930_f1b1_d4dc_72c2_803aeb181aad -->|calls| 88e2bfd3_c9cd_c8ac_4c2b_2911435fbb08
  2ef71e67_fa6d_b33f_d005_85a400698718["get()"]
  aea9c930_f1b1_d4dc_72c2_803aeb181aad -->|calls| 2ef71e67_fa6d_b33f_d005_85a400698718
  3502ba25_3930_5dea_9dd2_ebebc8b8095b["truncate()"]
  aea9c930_f1b1_d4dc_72c2_803aeb181aad -->|calls| 3502ba25_3930_5dea_9dd2_ebebc8b8095b
  ff178654_5fa6_94e9_c0b1_04b8c002c018["getHubFunctions()"]
  aea9c930_f1b1_d4dc_72c2_803aeb181aad -->|calls| ff178654_5fa6_94e9_c0b1_04b8c002c018
  style aea9c930_f1b1_d4dc_72c2_803aeb181aad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/tools/overview.ts lines 71–130

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

Called By

Frequently Asked Questions

What does renderOverview() do?
renderOverview() is a function in the mcp codebase, defined in src/tools/overview.ts.
Where is renderOverview() defined?
renderOverview() is defined in src/tools/overview.ts at line 71.
What does renderOverview() call?
renderOverview() calls 4 function(s): get, getHubFunctions, getKeyFilesForDomain, truncate.
What calls renderOverview()?
renderOverview() is called by 1 function(s): handler.

Analyze Your Own Codebase

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

Try Supermodel Free