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
  f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2["renderBriefSymbolContext()"]
  8e9da006_7e8b_e75f_f70b_e874951820d2["handler()"]
  8e9da006_7e8b_e75f_f70b_e874951820d2 -->|calls| f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2
  9efb304e_755f_f15e_7c58_cd704e785584["searchSymbolHandler()"]
  9efb304e_755f_f15e_7c58_cd704e785584 -->|calls| f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2
  76db10df_f560_1331_9608_6a46d322e405["annotateHandler()"]
  76db10df_f560_1331_9608_6a46d322e405 -->|calls| f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2
  d16dc47a_bbc0_2745_401a_8a4d3b67257e["normalizePath()"]
  f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2 -->|calls| d16dc47a_bbc0_2745_401a_8a4d3b67257e
  23115e73_71da_67e0_3f49_9af5167f6a1b["findDomain()"]
  f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2 -->|calls| 23115e73_71da_67e0_3f49_9af5167f6a1b
  55bde18a_7860_173e_f211_5874970475e3["get()"]
  f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2 -->|calls| 55bde18a_7860_173e_f211_5874970475e3
  style f0435cd0_6489_6dfd_b2b4_5d96d9d44fe2 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