Home / Function/ renderBriefSymbolContext() — mcp Function Reference

renderBriefSymbolContext() — mcp Function Reference

Architecture documentation for the renderBriefSymbolContext() function in symbol-context.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  233a620a_de76_be53_26cd_6e06fbe25d41["renderBriefSymbolContext()"]
  e5737e93_21e3_4389_2f31_c2c4b7b9ef6c["handler()"]
  e5737e93_21e3_4389_2f31_c2c4b7b9ef6c -->|calls| 233a620a_de76_be53_26cd_6e06fbe25d41
  0c9ec015_a9a0_5ced_2032_d9aa5a5efa81["searchSymbolHandler()"]
  0c9ec015_a9a0_5ced_2032_d9aa5a5efa81 -->|calls| 233a620a_de76_be53_26cd_6e06fbe25d41
  0dc81adb_6983_30fe_6ae1_4620d20c0ff0["annotateHandler()"]
  0dc81adb_6983_30fe_6ae1_4620d20c0ff0 -->|calls| 233a620a_de76_be53_26cd_6e06fbe25d41
  6666a1f2_0912_ade3_4b0e_42190c41cd97["normalizePath()"]
  233a620a_de76_be53_26cd_6e06fbe25d41 -->|calls| 6666a1f2_0912_ade3_4b0e_42190c41cd97
  26d5f729_7e5d_b48c_83ae_0c596ef3a161["findDomain()"]
  233a620a_de76_be53_26cd_6e06fbe25d41 -->|calls| 26d5f729_7e5d_b48c_83ae_0c596ef3a161
  d6ed9355_f977_306b_b0ef_d7220fdefe68["get()"]
  233a620a_de76_be53_26cd_6e06fbe25d41 -->|calls| d6ed9355_f977_306b_b0ef_d7220fdefe68
  style 233a620a_de76_be53_26cd_6e06fbe25d41 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/tools/symbol-context.ts lines 262–306

export function renderBriefSymbolContext(graph: IndexedGraph, node: CodeGraphNode): string {
  const name = node.properties?.name as string || '(unknown)';
  const rawFilePath = node.properties?.filePath as string || '';
  const filePath = normalizePath(rawFilePath);
  const startLine = node.properties?.startLine as number || 0;
  const endLine = node.properties?.endLine as number || 0;
  const kind = node.properties?.kind as string || node.labels?.[0]?.toLowerCase() || 'symbol';
  const language = node.properties?.language as string || '';

  const lines: string[] = [];

  lines.push(`## ${name}`);
  lines.push(`**Defined in:** ${filePath}${startLine ? ':' + startLine : ''}${endLine ? '-' + endLine : ''}`);
  lines.push(`**Type:** ${kind}${language ? ' (' + language + ')' : ''}`);

  const domain = findDomain(graph, node.id);
  if (domain) {
    lines.push(`**Domain:** ${domain}`);
  }

  // Callers (inline, max MAX_BRIEF_CALLERS)
  const adj = graph.callAdj.get(node.id);
  if (adj && adj.in.length > 0) {
    const callerNames = adj.in
      .map(id => graph.nodeById.get(id))
      .filter((n): n is CodeGraphNode => !!n)
      .map(n => `\`${n.properties?.name as string || '(unknown)'}\``)
      .slice(0, MAX_BRIEF_CALLERS);
    const suffix = adj.in.length > MAX_BRIEF_CALLERS ? `, ... (${adj.in.length} total)` : '';
    lines.push(`**Called by:** ${callerNames.join(', ')}${suffix}`);
  }

  // Callees (inline, max MAX_BRIEF_CALLEES)
  if (adj && adj.out.length > 0) {
    const calleeNames = adj.out
      .map(id => graph.nodeById.get(id))
      .filter((n): n is CodeGraphNode => !!n)
      .map(n => `\`${n.properties?.name as string || '(unknown)'}\``)
      .slice(0, MAX_BRIEF_CALLEES);
    const suffix = adj.out.length > MAX_BRIEF_CALLEES ? `, ... (${adj.out.length} total)` : '';
    lines.push(`**Calls:** ${calleeNames.join(', ')}${suffix}`);
  }

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

Domain

Subdomains

Frequently Asked Questions

What does renderBriefSymbolContext() do?
renderBriefSymbolContext() is a function in the mcp codebase.
What does renderBriefSymbolContext() call?
renderBriefSymbolContext() calls 3 function(s): findDomain, get, normalizePath.
What calls renderBriefSymbolContext()?
renderBriefSymbolContext() is called by 3 function(s): annotateHandler, handler, searchSymbolHandler.

Analyze Your Own Codebase

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

Try Supermodel Free