Skip to main content

File Tools

AnyDB MCP can download files, upload small inline payloads, or transfer files of any size through a signed URL.

Available tools

ToolWhat it does
download_fileReturns a temporary download or preview URL for a file cell.
upload_fileFallback upload for clients that cannot send an HTTP PUT; accepts base64 or UTF-8 content inline.
prepare_file_uploadCreates a child File record and returns a signed PUT URL.
complete_file_uploadFinalizes a signed-URL upload after the bytes have been transferred.

Download a file

  1. Use get_record to identify the file cell and its cellpos.
  2. Call download_file with the team, workspace, record, and cell position.
  3. Open or fetch the returned URL immediately.

Normal download URLs expire after approximately 60 seconds. Request a new URL instead of caching an expired one. Set preview when the client should display the file inline.

Upload with a signed URL

This is the preferred upload flow for files of any size:

  1. Call prepare_file_upload with the filename, exact byte size, team, workspace, and parent record.
  2. PUT the raw bytes to the returned URL using the returned contentType.
  3. Call complete_file_upload with the File record ID returned by the prepare call, not the original parent record ID.

The bytes go directly to storage and do not pass through the model's context.

Upload inline

Use upload_file only when the MCP client cannot issue the signed-URL PUT request. Base64 is the default encoding; use contentEncoding: "utf8" for plain text.

Inline base64 increases payload size by approximately one-third. The client capability, rather than file size alone, should determine which upload flow to use.

Both upload methods create a separate child File record under the supplied parent. They do not overwrite content on the parent record.