Tool Details: file_write

Basic Information

Tool Name:file_write
Asset Name:Write File
Description:Write a file under a configured filesystem root or to an authorised DLFS path. Creates the file if absent and overwrites it otherwise. Parent directories must exist. Supply exactly one of content, value, bytes, or contentRef.
Adapter:file
Asset Hash:0x26f9bfc372c80cbc2b641aef21cd76af08a360d1bf9ffd6d585f980d47e3aab9
Input
PropertyTypeDescription
rootstringConfigured root name; omit for a canonical DLFS path
contentRefstringResolvable content reference to stream, including an asset, file:// root path, or DLFS path
valueanyJSON-serialisable value to write as UTF-8 JSON
contentstringUTF-8 text to write
bytesstringBase64-encoded bytes to write
assetstringLegacy alias for contentRef
path*stringPath relative to root, dlfs/<drive>/<path>, or <ownerDID>/dlfs/<drive>/<path>
Output
PropertyTypeDescription
createdbooleanTrue if the file was newly created
writtenintegerBytes written

MCP Tool Usage Examples

This tool can be called via the MCP (Model Context Protocol) endpoint. Here are examples of how to use it:

JSON-RPC Call Example:

POST to https://venue-2.covia.ai/mcp

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "file_write",
    "arguments": {
      "input": "your input here"
    }
  }
}
cURL Example:
curl -X POST https://venue-2.covia.ai/mcp \\
  -H "Content-Type: application/json" \\
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "file_write",
      "arguments": {
        "input": "your input here"
      }
    }
  }'
Python Example:
import requests
import json

url = "https://venue-2.covia.ai/mcp"
payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "file_write",
        "arguments": {
            "input": "your input here"
        }
    }
}

response = requests.post(url, json=payload)
result = response.json()
print(result)
JavaScript/Node.js Example:
const fetch = require('node-fetch');

const url = 'https://venue-2.covia.ai/mcp';
const payload = {
    jsonrpc: '2.0',
    id: 1,
    method: 'tools/call',
    params: {
        name: 'file_write',
        arguments: {
            input: 'your input here'
        }
    }
};

fetch(url, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data));

Asset Metadata

{
  "name": "Write File",
  "description": "Write a file under a configured filesystem root or to an authorised DLFS path. Creates the file if absent and overwrites it otherwise. Parent directories must exist. Supply exactly one of content, value, bytes, or contentRef.",
  "creator": "Covia",
  "operation": {
    "adapter": "file:write",
    "toolName": "file_write",
    "input": {
      "type": "object",
      "properties": {
        "root": { "type": "string", "description": "Configured root name; omit for a canonical DLFS path" },
        "path": { "type": "string", "description": "Path relative to root, dlfs/<drive>/<path>, or <ownerDID>/dlfs/<drive>/<path>" },
        "content": { "type": "string", "description": "UTF-8 text to write" },
        "value": { "description": "JSON-serialisable value to write as UTF-8 JSON" },
        "bytes": { "type": "string", "description": "Base64-encoded bytes to write" },
        "contentRef": { "type": "string", "description": "Resolvable content reference to stream, including an asset, file:// root path, or DLFS path" },
        "asset": { "type": "string", "deprecated": true, "description": "Legacy alias for contentRef" }
      },
      "required": ["path"]
    },
    "output": {
      "type": "object",
      "properties": {
        "written": { "type": "integer", "description": "Bytes written" },
        "created": { "type": "boolean", "description": "True if the file was newly created" }
      }
    }
  }
}

Navigation

Back to adapter details

Back to all adapters

Back to index