Home / Function/ saveCacheToDisk() — mcp Function Reference

saveCacheToDisk() — mcp Function Reference

Architecture documentation for the saveCacheToDisk() function in graph-cache.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  f6ef4bf8_5f3b_59ae_5ea0_00f1b9b2468e["saveCacheToDisk()"]
  966fdd0a_509a_01b0_865e_32cfde84f964["precacheForDirectory()"]
  966fdd0a_509a_01b0_865e_32cfde84f964 -->|calls| f6ef4bf8_5f3b_59ae_5ea0_00f1b9b2468e
  02005c31_96d4_6bb0_c689_f819a2d29a5f["sanitizeFileName()"]
  f6ef4bf8_5f3b_59ae_5ea0_00f1b9b2468e -->|calls| 02005c31_96d4_6bb0_c689_f819a2d29a5f
  style f6ef4bf8_5f3b_59ae_5ea0_00f1b9b2468e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/cache/graph-cache.ts lines 371–392

export async function saveCacheToDisk(
  cacheDir: string,
  repoName: string,
  raw: SupermodelIR,
  commitHash?: string
): Promise<string> {
  await fs.mkdir(cacheDir, { recursive: true });

  const fileName = `${sanitizeFileName(repoName)}.json`;
  const filePath = join(cacheDir, fileName);

  const payload = {
    version: 1,
    repoName,
    commitHash: commitHash || null,
    savedAt: new Date().toISOString(),
    raw,
  };

  await fs.writeFile(filePath, JSON.stringify(payload));
  return filePath;
}

Domain

Subdomains

Frequently Asked Questions

What does saveCacheToDisk() do?
saveCacheToDisk() is a function in the mcp codebase.
What does saveCacheToDisk() call?
saveCacheToDisk() calls 1 function(s): sanitizeFileName.
What calls saveCacheToDisk()?
saveCacheToDisk() is called by 1 function(s): precacheForDirectory.

Analyze Your Own Codebase

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

Try Supermodel Free