Back to MCP Overview

Files Tools

Tools for uploading, downloading, and managing files.

18 tools

Available Tools

files_list

List user files. Optional params: folderId (filter by folder, use "root" for root level), conversationId, sortBy ("uploadedAt", "size", "fileName"), sortOrder ("asc", "desc"), limit, offset. Returns {files[], total}.

Input Schema

conversationIdstring

Filter by conversation ID

folderIdstring

Filter by folder ID. Use "root" for root level

sortBystring

Sort field: "uploadedAt", "size", or "fileName"

sortOrderstring

Sort order: "asc" or "desc"

limitnumber

Max files to return (1-100, default: 50)

offsetnumber

Number of files to skip for pagination

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_list",
    "arguments": {
          "conversationId": "example",
          "folderId": "example",
          "sortBy": "example"
    }
  }
}
files_get

Get a specific file by ID

Input Schema

fileIdstringrequired

File ID from list

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_get",
    "arguments": {
          "fileId": "example"
    }
  }
}
files_getDownloadUrl

Get a time-limited download URL for a file (1 hour expiry)

Input Schema

fileIdstringrequired

File ID from list

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_getDownloadUrl",
    "arguments": {
          "fileId": "example"
    }
  }
}
files_delete

Delete a file (move to trash)

Input Schema

fileIdstringrequired

File ID to delete

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_delete",
    "arguments": {
          "fileId": "example"
    }
  }
}
files_rename

Rename a file

Input Schema

fileIdstringrequired

File ID to rename

newNamestringrequired

New file name

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_rename",
    "arguments": {
          "fileId": "example",
          "newName": "example"
    }
  }
}
files_move

Move a file to a different folder

Input Schema

fileIdstringrequired

File ID to move

folderIdstringrequired

Target folder ID, or null for root

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_move",
    "arguments": {
          "fileId": "example",
          "folderId": "example"
    }
  }
}
files_listFolders

List folders. Optional param "parentId" (null for root level folders). Returns array with id, name, parentId.

Input Schema

parentIdstring

Parent folder ID, or null for root level

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_listFolders",
    "arguments": {
          "parentId": "example"
    }
  }
}
files_createFolder

Create a new folder

Input Schema

namestringrequired

Folder name

parentIdstring

Parent folder ID, or null for root

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_createFolder",
    "arguments": {
          "name": "example",
          "parentId": "example"
    }
  }
}
files_renameFolder

Rename a folder

Input Schema

folderIdstringrequired

Folder ID to rename

newNamestringrequired

New folder name

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_renameFolder",
    "arguments": {
          "folderId": "example",
          "newName": "example"
    }
  }
}
files_deleteFolder

Delete an empty folder

Input Schema

folderIdstringrequired

Folder ID to delete. Folder must be empty.

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_deleteFolder",
    "arguments": {
          "folderId": "example"
    }
  }
}
files_getUsage

Get storage stats. No params. Returns {totalSize (bytes), fileCount}.

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_getUsage",
    "arguments": {}
  }
}
files_setAccessRules

Set access rules for a file. Controls who can create/read/delete files in published apps.

Input Schema

fileIdstringrequired

File ID from list

accessRulesobjectrequired

Access rules per operation (create/read/delete) — each a Condition (rule, legacy array, or { all | any | not } group with operators/function) — plus optional metadata (password/expiresAt/allowDownload).

trackCreatorboolean

Whether to track who uploads each file (default: true)

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_setAccessRules",
    "arguments": {
          "fileId": "example",
          "accessRules": {},
          "trackCreator": true
    }
  }
}
files_getAccessRules

Get access rules for a file

Input Schema

fileIdstringrequired

File ID from list

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_getAccessRules",
    "arguments": {
          "fileId": "example"
    }
  }
}
files_getFolderAccessRules

Get access rules for a folder (derived from files inside)

Input Schema

folderIdstringrequired

Folder ID

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_getFolderAccessRules",
    "arguments": {
          "folderId": "example"
    }
  }
}
files_setFolderAccessRules

Set access rules for all files in a folder. Files uploaded or moved into the folder (or its subfolders) later inherit these rules automatically unless the file has rules of its own.

Input Schema

folderIdstringrequired

Folder ID

accessRulesobjectrequired

Access rules to apply to all files in the folder (same Condition shape as files.setAccessRules).

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_setFolderAccessRules",
    "arguments": {
          "folderId": "example",
          "accessRules": {}
    }
  }
}
files_getQuota

Get storage quota info. Returns usedBytes, limitBytes, availableBytes, maxFileSizeBytes, percentUsed. Call BEFORE upload to check available space.

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_getQuota",
    "arguments": {}
  }
}
files_createUploadTicket

Get a one-shot URL to upload a file to, so the bytes never pass through the conversation as base64. Returns { uploadUrl, ticketId, expiresAt, method, headers } — send the raw file body with PUT. Refused up front (with availableBytes) if the file will not fit, so you never upload and then find out.

Input Schema

fileNamestringrequired

File name with extension

sizeBytesintegerrequired

Exact byte length of the file you are about to send. Checked against the plan and remaining storage NOW, and the upload is refused if the body does not match it.

mimeTypestring

MIME type (auto-detected from the extension if omitted)

folderIdstring

Target folder ID, or null for root

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_createUploadTicket",
    "arguments": {
          "fileName": "example",
          "sizeBytes": {},
          "mimeType": "example"
    }
  }
}
files_upload

Upload a file, either as base64 `content` or by giving a `sourceUrl` for the server to fetch. Prefer sourceUrl — it keeps the bytes out of the conversation. Check getQuota first for available space.

Input Schema

fileNamestringrequired

Original file name with extension

contentstring

Base64 encoded file content. Every byte travels through the caller — for anything already reachable over HTTPS use sourceUrl instead.

sourceUrlstring

HTTPS URL to fetch the file FROM, server-side. Use this instead of content whenever the bytes exist at a URL: nothing is base64-encoded through the caller, so a 1.7MB PDF costs a URL rather than ~600K tokens of transport. Same extension, size, quota and folder rules as a base64 upload.

mimeTypestring

MIME type (auto-detected if not provided; a sourceUrl response Content-Type is used when it is not given)

folderIdstring

Target folder ID, or null for root

Example Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "files_upload",
    "arguments": {
          "fileName": "example",
          "content": "example",
          "sourceUrl": "example"
    }
  }
}