Home / Function/ resolveDomain() — mcp Function Reference

resolveDomain() — mcp Function Reference

Architecture documentation for the resolveDomain() function in explore-function.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  3dd2d606_47d5_76c9_c834_83fbfb172417["resolveDomain()"]
  84fa1508_0318_0a6b_dd7c_b4917273b2b4["describeNode()"]
  84fa1508_0318_0a6b_dd7c_b4917273b2b4 -->|calls| 3dd2d606_47d5_76c9_c834_83fbfb172417
  fdc0fb6f_bf66_23e1_e32e_b17145da77c5["handler()"]
  fdc0fb6f_bf66_23e1_e32e_b17145da77c5 -->|calls| 3dd2d606_47d5_76c9_c834_83fbfb172417
  55bde18a_7860_173e_f211_5874970475e3["get()"]
  3dd2d606_47d5_76c9_c834_83fbfb172417 -->|calls| 55bde18a_7860_173e_f211_5874970475e3
  style 3dd2d606_47d5_76c9_c834_83fbfb172417 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/tools/explore-function.ts lines 100–134

function resolveDomain(
  graph: IndexedGraph,
  nodeId: string,
  subdomainToParent: Map<string, string>
): DomainInfo {
  let subdomain: string | null = null;
  let domain: string | null = null;

  for (const [name, data] of graph.domainIndex) {
    if (!data.memberIds.includes(nodeId)) continue;

    const domainNode = graph.nodeById.get(
      // Find the node for this domain entry to check its label
      [...graph.nameIndex.get(name.toLowerCase()) || []].find(id => {
        const n = graph.nodeById.get(id);
        return n?.labels?.[0] === 'Subdomain' || n?.labels?.[0] === 'Domain';
      }) || ''
    );

    if (domainNode?.labels?.[0] === 'Subdomain') {
      subdomain = name;
      // Look up parent domain via partOf map
      const parent = subdomainToParent.get(name);
      if (parent) domain = parent;
    } else if (domainNode?.labels?.[0] === 'Domain') {
      domain = name;
    }

    // If we found a subdomain, that's the most specific — prefer it
    if (subdomain) break;
  }

  // If we only found a domain directly (no subdomain), that's fine
  return { subdomain, domain };
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does resolveDomain() do?
resolveDomain() is a function in the mcp codebase.
What does resolveDomain() call?
resolveDomain() calls 1 function(s): get.
What calls resolveDomain()?
resolveDomain() is called by 2 function(s): describeNode, handler.

Analyze Your Own Codebase

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

Try Supermodel Free