Skip to main content
Glama
Strom-Capital

mcp-server-db2i

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB2I_PORTNoJDBC port (446 is standard for IBM i)446
DB2I_SCHEMANoDefault schema/library for tools. If set, you don't need to specify schema in each tool call.
DB2I_DATABASENoDatabase name*LOCAL
DB2I_HOSTNAMEYesIBM i hostname or IP address
DB2I_PASSWORDYesUser password
DB2I_USERNAMEYesIBM i user profile
DB2I_JDBC_OPTIONSNoAdditional JDBC options (semicolon-separated)

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
execute_queryB

Execute a read-only SQL SELECT query against the IBM Db2i database. Only SELECT statements are allowed for security. Results are limited by default to prevent large result sets.

list_schemasA

List all schemas (libraries) in the IBM Db2i database. Optionally filter by name pattern using * as wildcard.

list_tablesB

List all tables in a schema (library). Uses the system's default schema if not provided. Optionally filter by name pattern using * as wildcard.

search_tablesA

Find tables by name or description text across libraries. Matches TABLE_NAME, SYSTEM_TABLE_NAME, and TABLE_TEXT. Use * as a wildcard. When a schema allowlist is configured, only those libraries are searched. Otherwise system libraries (Q* and SYS*) are skipped unless include_system is true.

search_columnsA

Find columns by name or description text across libraries. Matches COLUMN_NAME, SYSTEM_COLUMN_NAME, and COLUMN_TEXT. Use * as a wildcard. When a schema allowlist is configured, only those libraries are searched. Otherwise system libraries (Q* and SYS*) are skipped unless include_system is true.

describe_tableA

Get detailed column information for a specific table including data types, lengths, nullability, defaults, and CCSID. Uses the system's default schema if not provided.

list_viewsA

List all views in a schema (library). Uses the system's default schema if not provided. Optionally filter by name pattern using * as wildcard.

list_indexesB

List all indexes for a specific table including uniqueness and column information. Uses the system's default schema if not provided.

get_table_constraintsB

Get all constraints (primary keys, foreign keys, unique constraints) for a specific table. Uses the system's default schema if not provided.

list_routinesA

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.

describe_routineA

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.

validate_queryA

Check a SQL statement without running it. Parses it with QSYS2.PARSE_STATEMENT and checks that referenced tables, columns, and qualified routines exist in the catalog. Also reports read-only and schema-allowlist findings.

get_object_ddlA

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.

get_related_objectsA

List views, indexes, triggers, and other objects that depend on a table, using SYSTOOLS.RELATED_OBJECTS. Requires IBM i 7.3 Technology Refresh 9, IBM i 7.4 Technology Refresh 3, or a later release.

get_journal_infoA

List the physical data files in a library with their journal, journal library, journal images, omitted entries, and whether they have a primary key, using QSYS2.OBJECT_STATISTICS. needs_attention is true when a table is not journaled, or has no primary key and does not journal both images, which journal-based replication tools need. Requires IBM i 7.3 Technology Refresh 2 or later.

search_ibmi_servicesA

Find IBM i SQL services (views, table functions, procedures, and more in QSYS2 and SYSTOOLS) in the catalog QSYS2.SERVICES_INFO, with the release that added each one and an example query. Call it before writing SQL that uses an IBM i service, instead of guessing names and parameters. With no query and no category, it lists the categories with a count each. This tool only reads the catalog. Running an example with execute_query still needs the IBM i authority the service documents and, when QUERY_ALLOWED_SCHEMAS is set, the service's schema in that list. Table functions must be qualified, as in TABLE(QSYS2.ACTIVE_JOB_INFO(DETAILED_INFO => 'NONE')), with plain values as arguments.

index_adviceA

List the indexes the query optimizer asked for on the tables of a library, from the IBM i index advisor (QSYS2.SYSIXADV). Rows with the same table, key columns, and index type are merged into one, with counts summed and reason codes described. Sorted by mti_used, then times_advised: advice where the optimizer kept building and reusing a maintained temporary index (MTI) is the strongest signal. key_columns are in CREATE INDEX order and can end in DESC. last_advised and since are in the system's local time. This tool only reads the advice; it does not create indexes.

profile_tableA

Profile a table for ETL work: row count, deleted rows, size, and last change from QSYS2.SYSTABLESTAT, plus per-column distinct count, null count, and low and high values. By default column numbers come from stored statistics in QSYS2.SYSCOLUMNSTAT (low and high are the second-lowest and second-highest values), and columns without collected statistics report source "none". Set compute to true to scan the table for exact numbers on up to 20 columns. Masked columns keep their counts and return no values.

get_business_contextA

List business entities, row filters most queries need (such as leaving out deleted rows), table and column descriptions, and relations that the catalog does not declare as foreign keys. Filter by entity or table. Omit both to return every annotation loaded from MCP_CUSTOM_TOOLS. An unknown entity name falls back to names that partly match it, and when nothing matches, the result lists the loaded entity names.

Prompts

Interactive templates invoked by user choice

NameDescription
explore_libraryList the tables in a library, describe the central ones, and summarize how they fit together.
explain_tableExplain a table in plain language: what a row is, what the columns mean, its keys, and its relations.
write_queryWrite a read-only SELECT that answers a question, grounded in the real columns of a table and its YAML annotations.

Resources

Contextual data attached and managed by the client

NameDescription
business_contextBusiness entities, table and column descriptions, and relations loaded from MCP_CUSTOM_TOOLS.

TDQS

A3.7/5.0

Scored across 19 tools

Disambiguation4/5

Most tools target clearly distinct resources or actions, such as list_tables vs list_views vs list_routines. A few overlaps exist between list_tables/search_tables, describe_table/search_columns, and list_indexes/get_related_objects/index_advice, but the descriptions generally explain the boundaries enough for correct selection.

Naming Consistency4/5

Names are overwhelmingly consistent snake_case with predictable verb_noun patterns like list_tables, describe_table, search_columns, and get_table_constraints. The main minor deviation is index_advice, which is noun-only rather than using a list_/get_ verb.

Tool Count4/5

19 tools is slightly above the typical sweet spot, but the breadth reflects genuinely different DB2 for i metadata and query-assistance needs. Each tool appears to map to a concrete catalog, service, or query operation rather than duplicating another tool.

Completeness4/5

The set covers a strong read-only lifecycle: schemas, tables, views, routines, columns, constraints, indexes, DDL, journaling, profiling, validation, and business context. Gaps remain around explain-plan tooling, explicit trigger/view listing, and any write/DDL execution, though the server appears deliberately read-only.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive