Skip to main content
Glama
Strom-Capital

mcp-server-db2i

Describe Routine

describe_routine
Read-onlyIdempotent

Inspect DB2 for i SQL procedures and functions to get parameters, return values, result columns, and a ready-to-use call template.

Instructions

Describe an SQL procedure or function from QSYS2.SYSPARMS: parameters in order with mode, data type, and default; the return value of a scalar function; and the result columns of a table function. An overloaded name returns every overload unless specific_name picks one. call_template is a statement with a ? marker per parameter. callable_with_execute_query says whether execute_query can run it: procedures (CALL) and functions that modify SQL data cannot, and note says why. Uses the system's default schema if not provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoRoutine name. Required unless specific_name is given.
schemaNoSchema (library) containing the routine. Uses the system's default schema if not provided.
specific_nameNoSpecific name of one overload, from list_routines.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
causeNoWhy the statement failed. &1-style placeholders stand for values in error.
countNo
errorNo
schemaNo
sqlcodeNoSQLCODE of the failed statement, such as -204
successYes
recoveryNoWhat to change before trying again
sqlstateNoSQLSTATE of the failed statement
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/closed-world annotations, it discloses non-obvious behavior: overloaded names return every overload, call_template uses a ? marker per parameter, and procedures (CALL) plus SQL-data-modifying functions cannot be run via execute_query, with note explaining why. That is substantive operating context the annotations do not provide.

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?

The description is dense but front-loaded, leading with what it returns before qualifying details. Each clause carries information, though the return-value enumeration is partly redundant given the output schema.

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?

For a 3-parameter read tool with an output schema, the description covers everything an agent needs: source catalog, overload semantics, execution eligibility, and default-schema fallback. Nothing required for correct invocation is missing.

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, but the description adds meaning: the name/specific_name mutual-exclusion rule is restated and default-schema fallback is confirmed. It does not add format or syntax detail beyond that.

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 opens with a specific verb and resource tied to a concrete source (QSYS2.SYSPARMS) and enumerates exactly what is described: parameter mode/type/default, scalar return value, and table-function result columns. This clearly separates it from describe_table and list_routines.

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

Usage Guidelines4/5

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

It states when the overload behavior applies ('An overloaded name returns every overload unless specific_name picks one') and routes execution decisions to callable_with_execute_query, naming execute_query as the related sibling. It stops short of explicitly saying to call list_routines first to obtain a specific_name, though the schema hints at it.

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