MCPcopy
hub / github.com/ChromeDevTools/chrome-devtools-mcp / saveTemporaryFile

Method saveTemporaryFile

src/McpContext.ts:784–796  ·  view source on GitHub ↗
(
    data: Uint8Array<ArrayBufferLike>,
    filename: string,
  )

Source from the content-addressed store, hash-verified

782 }
783
784 async saveTemporaryFile(
785 data: Uint8Array<ArrayBufferLike>,
786 filename: string,
787 ): Promise<{filepath: string}> {
788 const filepath = await getTempFilePath(filename);
789 await this.validatePath(filepath);
790 try {
791 await fs.writeFile(filepath, data);
792 } catch (err) {
793 throw new Error('Could not save a file', {cause: err});
794 }
795 return {filepath};
796 }
797
798 async saveFile(
799 data: Uint8Array<ArrayBufferLike>,

Callers 3

lighthouse.tsFile · 0.80
screenshot.tsFile · 0.80
tools.tsFile · 0.80

Calls 2

validatePathMethod · 0.95
getTempFilePathFunction · 0.85

Tested by

no test coverage detected