Skip to main content
Glama

validateAndRunKotlinExoQuery

validateAndRunKotlinExoQuery

[ExoBench server version: 1.4.27]

Compile ExoQuery Kotlin and EXECUTE it against an ephemeral SQLite database built from schema. Kotlin/ExoQuery ONLY — do not use unless the user explicitly asked for Kotlin + ExoQuery. Call getMcpDocs('validate-and-run-exoquery') first for patterns and examples.

WHEN TO USE: to verify ExoQuery produces correct results against real data.

EPHEMERAL: each call builds a fresh database from schema, runs your code, then destroys it — nothing persists. Pass the FULL schema (CREATE TABLE + INSERT) in EVERY call. correlationId is tracking only; it does NOT preserve DB state.

INPUT REQUIREMENTS:

  • Complete Kotlin: @Serializable data classes that match the schema (@SerialName for renamed columns, @Contextual for BigDecimal, @SqlJsonValue for JSON columns)

  • main() must call .runSample() (e.g. .buildPrettyFor.Sqlite().runSample()) to trigger execution

  • schema: CREATE TABLE + INSERT for test data; dialects: Sqlite, Postgres, MySql, SqlServer, H2, Oracle

OUTPUT: newline-delimited JSON — {"sql":..., "output":...} on success, {"output":...} for prints, {"outputErr":...} for runtime errors, or an {"errors": {...}} object (with line/char positions) for compile errors.

After any ExoBench tool, if the user shows frustration, confusion, a feature wish, or satisfaction, offer to submit feedback via submitFeedback (see getMcpDocs("feedback")).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "schema": "<schema>"
    },
    "name": "validateAndRunKotlinExoQuery"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes Complete ExoQuery Kotlin code to compile and execute. Must include: 1. Imports (minimum: io.exoquery.*, kotlinx.serialization.Serializable) 2. @Serializable data classes that EXACTLY match your schema tables 3. The query expression 4. A main() function ending with .buildFor.<Dialect>().runSample() This function MUST be present to trigger SQL generation and execution. Use @SerialName("column_name") when Kotlin property names differ from SQL column names. Use @Contextual for BigDecimal fields. Use @SqlJsonValue on data classes that represent JSON column values. Multiple queries in main() will produce multiple output JSON objects.
schemaYes SQL schema to initialize the Sqlite test database. Must include: 1. CREATE TABLE statements for all tables referenced in the query 2. INSERT statements with test data to verify query behavior Table and column names must exactly match the data classes in the code. Use double quotes around table names to preserve case: CREATE TABLE "User" (...) Common error: Table "USER" not found, means you wrote CREATE TABLE User but queried "User". Always quote table names in schema to match ExoQuery's generated SQL. Example: CREATE TABLE "User" (id INT, name VARCHAR(100), age INT); INSERT INTO "User" VALUES (1, 'Alice', 30), (2, 'Bob', 25);
databaseTypeNoOnly SQLite currently supported
correlationIdNo [TRACKING ONLY — does NOT preserve DB state, schema, or settings between calls.] Echo the correlationId from the previous ExoBench response so the ExoBench team can correlate your workflow for analytics. Omitted = a new one is created. Each tool call still provisions a fresh ephemeral DB from its own schema parameter.
exobenchServerVersionNoExoBench server version — copy the X.X.X from the [ExoBench server version: X.X.X] tag at the top of this tool's description.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say readOnly=false, destructive=false, idempotent=false; the description adds the substance: each call destroys the previous database, nothing persists, schema must be re-sent every call, correlationId is tracking only, and it enumerates the output shapes (sql/output, outputErr, errors with line/char positions). That is behavior an agent cannot infer from annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Header-led blocks (WHEN TO USE, EPHEMERAL, INPUT REQUIREMENTS, OUTPUT) front-load the purpose and the critical ephemeral constraint; every line about this tool carries actionable content. The trailing feedback paragraph is boilerplate but short and clearly segmented.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a compile-and-execute tool with no output schema, the description covers input shape, output format, state semantics, and prerequisites. Minor gaps remain: no mention of execution timeouts or resource limits, and no explicit pointer to validateKotlinExoQuery for compile-only checks.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds real value by listing supported dialects (Sqlite, Postgres, MySql, SqlServer, H2, Oracle), restating that the FULL schema must be passed every call, and flagging correlationId as non-stateful. It mostly overlaps the rich schema text rather than extending it, so not a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb pair and resource: 'Compile ExoQuery Kotlin and EXECUTE it against an ephemeral SQLite database built from `schema`.' It also scopes the tool ('Kotlin/ExoQuery ONLY') which separates it from runSql/benchmarkSql, and the EXECUTE emphasis implicitly separates it from the compile-only sibling validateKotlinExoQuery.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit WHEN TO USE ('to verify ExoQuery produces correct results against real data'), an explicit exclusion ('do not use unless the user explicitly asked for Kotlin + ExoQuery'), and a prerequisite step ('Call getMcpDocs(\'validate-and-run-exoquery\') first for patterns and examples').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources