Skip to main content
Glama

validateKotlinExoQuery

validateKotlinExoQuery

[ExoBench server version: 1.4.27]

Compile ExoQuery Kotlin code and return the generated SQL or compilation errors — WITHOUT executing. Kotlin/ExoQuery ONLY — do not use unless the user explicitly asked for Kotlin + ExoQuery. Call getMcpDocs('validate-exoquery') first for patterns and examples.

WHEN TO USE: to validate ExoQuery syntax or inspect the generated SQL without running it against data.

INPUT REQUIREMENTS:

  • Complete Kotlin including imports and @Serializable data classes (@SerialName for renamed columns, @Contextual for BigDecimal, @SqlJsonValue for JSON columns)

  • Code must end with .buildFor.().runSample() or .buildPrettyFor.().runSample()

  • Dialects: Sqlite, Postgres, MySql, SqlServer, H2, Oracle

OUTPUT: {"sql": "..."} on success, or an {"errors": {...}} object with line/char positions and messages on compilation error.

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>"
    },
    "name": "validateKotlinExoQuery"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes Complete ExoQuery Kotlin code to compile. Must include: 1. Imports (minimum: io.exoquery.*, kotlinx.serialization.Serializable) 2. @Serializable data classes matching your query entities 3. The query expression using sql { ... } or sql.select { ... } 4. A main() function ending with .buildFor.<Dialect>().runSample() or .buildPrettyFor.<Dialect>().runSample() This function MUST be present to trigger SQL generation. The runSample() function triggers SQL generation but does NOT execute the query for validateKotlinExoQuery. (Note that this is NOT for production ExoQuery usage. For that you use `.runOn(database)`.) Dialect is part of the code (e.g., .buildFor.Postgres()), NOT a separate parameter. If compilation fails, check the error interval positions to locate the exact issue in your code.
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.6/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the exact output shape on success ({'sql': ...}) and on failure ({'errors': {...}} with line/char positions), and reiterates that nothing is executed against data despite the annotations declaring readOnlyHint=false. Also documents required code structure (imports, @Serializable, .buildFor.<Dialect>().runSample()) and the supported dialect set.

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

Conciseness4/5

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

Well front-loaded with a one-line summary followed by WHEN TO USE / INPUT REQUIREMENTS / OUTPUT headers, which scans quickly. Minor waste: the input requirements duplicate the `code` parameter description almost verbatim, and the version-tag line plus feedback boilerplate are server furniture rather than tool guidance.

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

Completeness5/5

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

No output schema exists, but the description supplies the return format for both success and error paths, the required code shape, and the dialect enumeration. For a single-required-parameter compile tool, an agent has everything needed to construct a valid call and interpret the result.

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

Parameters3/5

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

Schema coverage is 100%, so all three parameters (code, correlationId, exobenchServerVersion) are already documented in the schema. The description's INPUT REQUIREMENTS section largely restates the code constraint that the schema already spells out (dialect in code rather than a parameter, mandatory runSample() terminator), adding little new parameter meaning. Baseline 3 is appropriate given the schema does the work.

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?

Opening sentence names a specific verb (Compile) and resource (ExoQuery Kotlin code) and states exactly what is returned on both success and failure, plus the critical scope boundary 'WITHOUT executing'. An agent can distinguish this from the run-and-execute sibling (validateAndRunKotlinExoQuery) purely from the text.

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?

Explicit WHEN TO USE ('validate ExoQuery syntax or inspect the generated SQL without running it'), an explicit exclusion ('Kotlin/ExoQuery ONLY — do not use unless the user explicitly asked for Kotlin + ExoQuery'), and a prerequisite step ('Call getMcpDocs(\'validate-exoquery\') first'). The 'without running it' framing implicitly routes the agent away from the execution variant.

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