MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / writeFile

Function writeFile

projects/runtime-node/src/localFiles.ts:183–192  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

181 },
182
183 async writeFile(params) {
184 const record = asRecord(params)
185 const targetPath = stringValue(record, "path")
186 const encoding = encodingValue(record.encoding)
187 const content = typeof record.content === "string" ? record.content : ""
188 if (boolValue(record.createDirectory)) await fs.mkdir(path.dirname(targetPath), { recursive: true })
189 await fs.writeFile(targetPath, content, encoding)
190 const stat = await fs.stat(targetPath)
191 return { ok: true, path: targetPath, size: stat.size, encoding }
192 },
193
194 async createDirectory(params) {
195 const record = asRecord(params)

Callers 12

files.test.tsFile · 0.85
writeEchoMcpServerFunction · 0.85
queryMethod · 0.85
createSessionFileFunction · 0.85
sessions.test.tsFile · 0.85
writeMcpConfigJsonFunction · 0.85
buildCodexArgsFunction · 0.85
resolveCodexPromptFunction · 0.85
createSessionFileFunction · 0.85
sessions.test.tsFile · 0.85

Calls 5

encodingValueFunction · 0.85
boolValueFunction · 0.85
writeFileMethod · 0.80
asRecordFunction · 0.70
stringValueFunction · 0.70

Tested by 2

createSessionFileFunction · 0.68
createSessionFileFunction · 0.68