Hotfolder - ToolGate tool package

examples.hotfolder

Package examples.hotfolder. Tools (MCP name hotfolder.<tool>): list, read_text, file_info, hash, search_text, write_text, append_text, mkdir, move, copy. Part of the Java Tool SDK examples.

By ToolGate Examples Signed

Java 17, protocol 2

Download

Use in ToolGate

In the ToolGate console, open Server packages, then Marketplace, and install this package. These values identify exactly what you install:

{
    "marketplace": "olo-labs-marketplace",
    "packageId": "examples.hotfolder",
    "version": "0.1.0",
    "packageDigest": "sha256:27056810f9dae1a34d40337f37a6b738cd74069d1b9263815cf38b553c08cc44"
}

Overview

HotFolder

Package examples.hotfolder. Tools (MCP name hotfolder.<tool>): list, read_text, file_info, hash, search_text, write_text, append_text, mkdir, move, copy. Part of the Java Tool SDK examples.

Text files in a protected folder on an enrolled device. Every tool is a @ClientTool: it runs only on the device the caller selects, and it reaches files only through ToolContext.files(). The package holds all of the tool behaviour; the device provides one generic, confined files area (ADR 027) and nothing specific to this package.

Safety

  • @DeviceFileAccess declares the access each tool needs (DEVICE_FILES_READ, or DEVICE_FILES_WRITE for the five that change files). The administrator sees and grants these permissions; Control signs them into the device's registration.
  • The device confines every path to its one service-owned folder: no .., absolute paths, hidden names, links or other users' files, only allowed text file types, and bounded file sizes, folder capacity and file operations per call.
  • A call may only touch the paths it was invoked with: path and destination must be arguments of that call.
  • move and copy never overwrite an existing destination. A missing file is reported as data (exists: false, moved: false), so the examples hold in an empty folder, which is how a device self-tests the package.

Try it

toolgate dev      # an MCP server over stdio
toolgate pack     # build/toolgate/hotfolder-0.1.0.tgpkg

Tools

hotfolder.append_text Non idempotent
Append to a text file Appends text, creating the file when needed.
hotfolder.copy Non idempotent
Copy a file Copies a file to a new path that does not exist yet.
hotfolder.file_info Read only
File size Reports whether a file exists and its size.
hotfolder.hash Read only
Hash a file SHA-256 of a text file.
hotfolder.list Read only
List files Lists the files and folders in a folder of the HotFolder, or all of them.
hotfolder.mkdir Idempotent
Create a folder Creates a folder inside the HotFolder.
hotfolder.move Non idempotent
Move a file Moves a file to a new path that does not exist yet.
hotfolder.read_text Read only
Read a text file Reads a UTF-8 text file from the HotFolder.
hotfolder.search_text Read only
Search a file Line numbers of a text file that contain the query.
hotfolder.write_text Idempotent
Write a text file Creates or replaces a text file.

Settings it needs

No settings.

Versions

VersionAPI changeCompatibilityPublished
0.1.0 none Java 17, protocol 2 17 Oct 2026 - 21:40

Publisher

ToolGate Examples, OLO Labs

Publisher details are supplied by the publisher. Validation checks package format, not code safety.