Disk - ToolGate tool package

examples.disk

Tools: disk.space, disk.largest. 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.disk",
    "version": "0.1.0",
    "packageDigest": "sha256:8825baa936eb05dc279b2ddf40fbfd431b06cec001505413e2eb25014da434f5"
}

Overview

Disk usage

Tools: disk.space, disk.largest. Part of the Java Tool SDK examples.

disk.space lists every volume with size, free space and percent used, fullest first. disk.largest finds the largest files and immediate sub-directories under a directory, to show what is filling a disk.

Safety

  • disk.largest looks only inside AllowedRoots, refuses .., and does not follow links.
  • A call visits at most MaxFilesVisited files and says when it stopped early. Unreadable directories are skipped.

Settings

Globals unless marked. Set them in toolgate.dev.json for development, as TOOLGATE_GLOBAL_<NAME> (or TOOLGATE_DESTINATION_<NAME>, TOOLGATE_SECRET_<NAME>) for a standalone jar, or on the deployment under ToolGate.

Setting Default Meaning
AllowedRoots . Comma-separated directories disk.largest may look inside.
MaxFilesVisited 200000 Most files one call looks at.

Try it

cp toolgate.dev.example.json toolgate.dev.json   # then edit it; never commit toolgate.dev.json
toolgate dev                                      # an MCP server over stdio
toolgate pack                                     # build/toolgate/disk-usage-0.1.0.tgpkg

Things to ask a model connected to it:

  • "Is any disk nearly full?"
  • "What is using the space in /var?"

Tools

disk.largest Read only
Largest files Finds the largest files and sub-directories under a directory inside the allowed roots, to show what is filling a disk.
disk.space Read only
Disk space Lists this machine's disk volumes with size, free space and percent used, fullest first.

Settings it needs

NameKindTypeDefaultDescription
AllowedRootsglobalSTRING.Comma-separated directories that disk.largest may look inside, such as /var,/opt/app or D:\data.
MaxFilesVisitedglobalINT200000Most files one disk.largest call looks at; the result says when it stopped early.

Versions

VersionAPI changeCompatibilityPublished
0.1.0 none Java 17, protocol 2 15 Oct 2026 - 11:55

Publisher

ToolGate Examples, OLO Labs

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