Skip to main content
Glama
Strom-Capital

mcp-server-db2i

List Routines

list_routines
Read-onlyIdempotent

Lists SQL procedures and functions in a DB2 for i library, showing type, language, and external program; use it to find routines before describing parameters.

Instructions

List SQL procedures and functions in a library from QSYS2.SYSROUTINES, one row per specific routine, so overloads appear once each. Shows the type (procedure, scalar function, or table function), language, external program, SQL data access, result sets, and text. Use describe_routine for parameters and a call template. Uses the system's default schema if not provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoOnly procedures or only functions. Omit for both.
limitNoMaximum routines to return. Capped by QUERY_MAX_LIMIT.
filterNoFilter routine names. Use * as wildcard, e.g. "GET*". Without a wildcard, matches names containing the text.
schemaNoSchema (library) to list routines in. Uses the system's default schema if not provided.

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.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so safety is covered. Beyond that, the description adds real behavioral detail: it documents the deduplication semantics for overloads and enumerates the returned attributes (type, language, external program, SQL data access, result sets, text). It omits the limit/QUERY_MAX_LIMIT behavior, leaving that to the schema.

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?

Front-loaded with the purpose and the source view, then the dedup rule and the routing hint. The column enumeration in sentence two is somewhat list-heavy but still informative rather than filler. No wasted preamble.

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?

An output schema exists, so return values need no further explanation, and annotations carry the safety profile. Combined with the schema's full parameter documentation, the description supplies everything an agent needs to select and call this tool correctly.

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%, so the schema already documents type, limit, filter, and schema thoroughly. The description restates only the default-schema behavior, adding no syntax or filter-format guidance beyond what the schema provides. Baseline 3 is appropriate.

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 states a specific verb and resource ('List SQL procedures and functions in a library') and anchors it to its source (QSYS2.SYSROUTINES), with the notable qualifier 'one row per specific routine, so overloads appear once each'. That granularity lets an agent distinguish it from list_tables, list_views, and describe_routine without opening a schema.

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 explicitly routes complementary work elsewhere: 'Use describe_routine for parameters and a call template', which tells the agent when this tool is insufficient. It also clarifies the default-schema fallback. It does not, however, state exclusions or contrast against sibling listing tools such as search_ibmi_services.

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