Csv - ToolGate tool package

examples.csv

Tools: csv.query, csv.files. 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.csv",
    "version": "0.1.0",
    "packageDigest": "sha256:8517a248687b2c4918ec79c94e50c3ffdae306a0af1c2dd7a98c8c01a481ea20"
}

Overview

CSV query

Tools: csv.query, csv.files. Part of the Java Tool SDK examples.

Answers questions from CSV exports (reports, inventories, audit extracts) without a database. csv.files lists the files and their columns. csv.query filters rows with conditions such as status=FAILED, amount>500 or customer~acme (=, !=, >, >=, <, <=, and ~ for contains; numbers compare as numbers), picks columns, sorts, and with groupBy returns one row per group with a count and, with sum, a total. Handles quoted fields, ;, tab and | delimiters, and a UTF-8 byte-order mark.

Safety

  • Reads only .csv, .tsv and .txt files directly in DataDir, up to MaxFileMegabytes.
  • Returns at most limit rows and says when there were more.

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
DataDir data Directory holding the CSV files. Absolute under a Tool Host.
MaxFileMegabytes 100 Largest file a call reads.

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/csv-query-0.1.0.tgpkg

Things to ask a model connected to it:

  • "Which regions had the most failed orders last month? Use orders.csv."
  • "List the customers with orders over 500 that failed."

Tools

csv.files Read only
List CSV files Lists the CSV files that csv.query can read, with their columns.
csv.query Read only
Query a CSV file Reads a CSV file from the data directory and returns the rows matching every condition, with chosen columns, sorted. With groupBy it returns one row per group with a count and, with sum, a total.

Settings it needs

NameKindTypeDefaultDescription
DataDirglobalSTRINGdataDirectory holding the CSV files callers may query. Use an absolute path under a Tool Host.
MaxFileMegabytesglobalINT100Largest CSV file a call reads.

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.