Skip to main content
Glama
Strom-Capital

mcp-server-db2i

Profile Table

profile_table
Read-onlyIdempotent

Profile DB2 for i tables for ETL by returning row counts, deleted rows, size, last change, and column distinct/null counts with value ranges; optionally scan up to 20 columns for exact stats.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name
schemaNoSchema (library) that contains the table. Uses the system's default schema if not provided.
columnsNoColumns to profile. Defaults to every column (the first 20 when compute is true).
computeNoScan the table for exact counts, MIN, and MAX. Slower on large tables. Default false.

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already establish this is a safe, idempotent read, and the description layers on substantial extra context: the source system tables, that low/high are the second-lowest/second-highest values, that unstatted columns report source "none", that masked columns return counts but no values, and the compute row-scan cost. These are exactly the non-obvious behaviors an agent needs before invoking.

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?

Three dense sentences, each carrying distinct information (what is profiled, default source, compute opt-in, masking). It is front-loaded with the deliverable and wastes little, though the second sentence is long and packs several ideas that could be split for faster scanning.

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?

With an output schema present, the description need not explain return values, and it instead covers the behavioral gaps: data sources, stats staleness semantics, masking, and compute limits. For a profiling tool with subtle stat-based defaults, nothing an agent needs to call it correctly 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 schema does not: compute's 20-column ceiling, that the default column set is every column vs. the first 20 under compute, and the masking behavior that affects which parameters yield values. It stops short of documenting the schema parameter's fallback beyond what the schema already says.

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 opens with a specific verb+resource ("Profile a table for ETL work") and enumerates exactly what is produced: row count, deleted rows, size, last change, and per-column distinct/null/low/high values. This is far more informative than a tautology, though it never names or contrasts itself with the closest sibling, describe_table, which an agent may consider a substitute.

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 clearly states the default behavior (stats from SYSCOLUMNSTAT) and the condition that changes it ("Set compute to true to scan the table for exact numbers"), including the cost tradeoff ("Slower on large tables") and the 20-column cap. There is no explicit when-not or named alternative, but the context for choosing compute is unambiguous.

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