Skip to main content
Glama
igorolv

jdbc-mcp-server

getViewDefinition

getViewDefinition
Read-onlyIdempotent

Retrieve the SQL definition of a specified view or materialized view from a JDBC database. Provide connection and view name to get the underlying CREATE statement.

Instructions

Return the SQL text that defines one known view or materialized view. For its exposed fields, keys and other object metadata, use describeTable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
schemaNo
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds the 'known view' constraint and the return type (SQL text), which is useful but not deeply behavioral; it does not describe error cases or catalog assumptions.

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?

Two sentences with no filler. The core behavior is front-loaded, and the alternative tool is mentioned immediately after the main statement. Every word earns its place.

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 simple read-only metadata tool with rich annotations, the description is mostly complete: it states what is returned, scopes the operation to known views, and names the sibling for metadata. The main gap is the lack of parameter-level guidance for name/schema, but the overall shape is adequate.

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

Parameters2/5

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

Schema description coverage is only 33%, with only 'connection' described in the schema. The description does not explain the 'name' or 'schema' parameters or how they relate to the 'known view' concept, so it fails to compensate for the low coverage.

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?

The description uses a specific verb ('Return') and resource ('SQL text that defines one known view or materialized view'), making the tool's function immediately clear. It also distinguishes itself from describeTable by explicitly routing metadata needs elsewhere.

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?

The description gives clear usage context: use this when you need the defining SQL of a known view/materialized view. It also names describeTable as the alternative when exposed fields, keys, or object metadata are needed, which is an explicit when-not condition.

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