Tool Details: file_read

Basic Information

Tool Name:file_read
Asset Name:Read File
Description:Read a file from a configured filesystem root or an authorised DLFS path. The mode controls decoding: auto (default), text, bytes, or json. Binary auto reads return a WebDAV URL when one is available, otherwise inline base64.
Adapter:file
Asset Hash:0x8d3239aaa104783adbfa1353cca28d93f5e056493f02ae2a30631030ef76eef1
Input
PropertyTypeDescription
path*stringPath relative to root, dlfs/<drive>/<path>, or <ownerDID>/dlfs/<drive>/<path>
rootstringConfigured root name; omit for a canonical DLFS path
maxCharsintegerWith mode 'extract': cap the returned text (the module's default applies when omitted); 'truncated' reports when it cut and 'lastPage' how far it got
pagesanyWith mode 'extract': a page (or slide) number, a range like "3-5", or {first, last} — 1-based, inclusive
modestringDecoding mode (default 'auto'). 'extract' returns the readable text of a PDF or Office document with pages marked — needs the documents module (v/info/adapters/documents lists the supported types).
Output
PropertyTypeDescription
encodingstring'utf-8', 'base64', or 'binary' (absent for mode=json)
sizeintegerFile size in bytes
urlstringWebDAV URL when auto mode returns a binary reference
valueanyParsed JSON value (mode=json only)
contentstringFile content for modes auto/text/bytes (text or base64)
mimestringBest-guess MIME type from extension and content sniffing

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-3.covia.ai/mcp

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

url = "https://venue-3.covia.ai/mcp"
payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "file_read",
        "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-3.covia.ai/mcp';
const payload = {
    jsonrpc: '2.0',
    id: 1,
    method: 'tools/call',
    params: {
        name: 'file_read',
        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": "Read File",
  "description": "Read a file from a configured filesystem root or an authorised DLFS path. The mode controls decoding: auto (default), text, bytes, or json. Binary auto reads return a WebDAV URL when one is available, otherwise inline base64.",
  "creator": "Covia",
  "operation": {
    "adapter": "file:read",
    "readOnly": true,
    "toolName": "file_read",
    "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>" },
        "mode": { "type": "string", "enum": ["auto", "text", "bytes", "json", "extract"], "description": "Decoding mode (default 'auto'). 'extract' returns the readable text of a PDF or Office document with pages marked — needs the documents module (v/info/adapters/documents lists the supported types)." },
        "pages": { "description": "With mode 'extract': a page (or slide) number, a range like \"3-5\", or {first, last} — 1-based, inclusive" },
        "maxChars": { "type": "integer", "description": "With mode 'extract': cap the returned text (the module's default applies when omitted); 'truncated' reports when it cut and 'lastPage' how far it got" }
      },
      "required": ["path"]
    },
    "output": {
      "type": "object",
      "properties": {
        "content": { "type": "string", "description": "File content for modes auto/text/bytes (text or base64)" },
        "value": { "description": "Parsed JSON value (mode=json only)" },
        "encoding": { "type": "string", "description": "'utf-8', 'base64', or 'binary' (absent for mode=json)" },
        "size": { "type": "integer", "description": "File size in bytes" },
        "mime": { "type": "string", "description": "Best-guess MIME type from extension and content sniffing" },
        "url": { "type": "string", "description": "WebDAV URL when auto mode returns a binary reference" }
      }
    }
  }
}

Navigation

Back to adapter details

Back to all adapters

Back to index