Skip to main content
Glama
Strom-Capital

mcp-server-db2i

Get Object DDL

get_object_ddl
Read-onlyIdempotent

Retrieve the SQL DDL that recreates a DB2 for i object such as a table, view, or procedure. Uses QSYS2.GENERATE_SQL and returns the statements without running them.

Instructions

Return the SQL DDL that recreates a database object, using QSYS2.GENERATE_SQL. Does not run the generated statements. Requires IBM i 7.3 or later.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesObject type: TABLE, VIEW, INDEX, ALIAS, TRIGGER, FUNCTION, PROCEDURE, or SEQUENCE
objectYesObject name
schemaNoSchema (library) that contains the object. Uses the system's default schema if not provided.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ddlNo
typeNo
errorNo
objectNo
schemaNo
successYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so the safety profile is covered. The description adds genuinely new behavioral context beyond that: the output is DDL only and is not executed, and it carries a platform version requirement (IBM i 7.3+).

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?

Three short, front-loaded sentences with no filler. The core action comes first, then the non-execution caveat, then the version requirement.

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?

An output schema exists, so return values need no explanation, and annotations cover the safety profile. The description supplies the mechanism and version prerequisite; only the routing against sibling tools is absent, which is a minor gap for this fairly self-contained tool.

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 description coverage is 100%, with an enum on 'type' and clear text on 'object' and 'schema', so the schema does the heavy lifting. The description adds no parameter detail (e.g., format of 'object', qualified name handling), matching the baseline 3 when coverage is complete.

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

Purpose4/5

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

The description states a specific verb and resource: return the SQL DDL that recreates a database object, and names the underlying mechanism (QSYS2.GENERATE_SQL). This is clearly distinct from metadata-oriented siblings like describe_table, though no sibling is named explicitly to sharpen the contrast.

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

Usage Guidelines3/5

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

It implies usage via a behavioral caveat ('Does not run the generated statements') and a version prerequisite ('Requires IBM i 7.3 or later'), but never states when to choose this over describe_table or execute_query, nor any explicit exclusions. Adequate context, but no alternative routing.

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