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
  70483507_2c71_464c_1cbc_d74d4479f5e1["resolveDomain()"]
  129c63b6_9648_d4bb_3c4d_03d461c6ad68["describeNode()"]
  129c63b6_9648_d4bb_3c4d_03d461c6ad68 -->|calls| 70483507_2c71_464c_1cbc_d74d4479f5e1
  1767161e_720a_f6c8_bf00_3dc68740b823["handler()"]
  1767161e_720a_f6c8_bf00_3dc68740b823 -->|calls| 70483507_2c71_464c_1cbc_d74d4479f5e1
  d6ed9355_f977_306b_b0ef_d7220fdefe68["get()"]
  70483507_2c71_464c_1cbc_d74d4479f5e1 -->|calls| d6ed9355_f977_306b_b0ef_d7220fdefe68
  style 70483507_2c71_464c_1cbc_d74d4479f5e1 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