Omit --port if the server uses the default (50000).
Step 4: Save and Test Source Connection
Call the configure tool with source_connection set to <CONNECTION_NAME>. The MCP server runs scai connection test internally and only persists the connection if the test passes.
On success: the response includes connection_test: ok.
On failure: the tool returns an error containing the scai message. Surface it to the user, help them fix the issue, then re-run configure(source_connection=<CONNECTION_NAME>).
Common errors:
Error
Cause
Solution
Operation timed out
Network / firewall
Check VPN, security groups, firewall rules
SQL30081N (communication error)
Wrong host/port or server down
Verify host, port (default 50000), and that DB2 is listening
SQL1013N (database not found)
Wrong database name
Verify the database alias / name on the server
SQL30082N (auth failed)
Bad credentials
Re-check username and password
CHECKPOINT
Confirm with user:
configure returned connection_test: ok
Connection appears in scai connection list -l db2 --json
Source connection saved to session config
On Completion
After the CHECKPOINT passes, tell the user:
Connection configured — Successfully connected to DB2 using connection <connection_name>.
Then return to the calling skill.
Security Rules
NEVER log or display secrets (passwords) in plain text.
NEVER include secrets in command-line arguments that might be logged. Prefer a credential manager (e.g. 1Password op run, or use /secrets capability from Cortex Code to store them).
Quick Reference
Action
Command
Add connection
scai connection add-db2 -s NAME --auth standard --host HOST --port 50000 --database DB --user USER --password PASS
Test connection
configure(source_connection=NAME) (runs the test internally)
List connections
scai connection list -l db2 --json
Set default
scai connection set-default -l db2 -c NAME
Extract code
scai code extract -s NAME --json
1---2name: db2-connection3description: DB2 Connection Skill4---56# DB2 Connection Skill78## On Entry910Tell the user:11> **Setting up DB2 connection** — I'll configure and test a connection to your source IBM DB2 (LUW) database. I'll need a few connection details.1213## Prerequisites1415- Network access to the DB2 host (self-hosted LUW or cloud-hosted)16- DB2 username and password with read access to the system catalog (`SYSCAT`)17- The `scai` CLI installed and available1819## Required Connection Details2021### Standard Auth (only auth method supported in MVP)2223| Parameter | Required | Description |24|-----------|----------|-------------|25| `-s, --source-connection` | Yes | Friendly name for this source connection |26| `--auth` | Yes | `standard` |27| `--host` | Yes | DB2 host |28| `--port` | No | TCP port (default: `50000`) |29| `--database` | Yes | Database name |30| `--user` | Yes | DB2 username |31| `--password` | Yes | DB2 password |32| `--connection-timeout` | No | Connection timeout in seconds |3334> DB2 is read through the `ibm_db` DB-API driver, which stages Parquet — there is no ODBC install required on the worker host.3536## Workflow3738### Step 1: Ask How to Provide Credentials3940Ask the user:41> "I need the following to connect to DB2:42> - **Host**43> - **Port** (default `50000`)44> - **Database name**45> - **Username** and **password**46>47> How would you like to provide these?"4849Options:501. **1Password** — Credentials stored in 1Password vault512. **Enter manually** — Provide values directly5253### Step 2: Route Based on Answer5455| User says | Action |56|-----------|--------|57| "1Password" | Follow `../1PASSWORD.md` (DB2 section) |58| "Enter manually" | Proceed to Step 3 |59| Other credential manager | Check if `../references/<NAME>.md` exists; if not, ask user to explain their setup |6061### Step 3: Add the Connection6263```bash64scai connection add-db2 \65 -s <CONNECTION_NAME> \66 --auth standard \67 --host <HOST> \68 --port <PORT> \69 --database <DATABASE> \70 --user <USERNAME> \71 --password <PASSWORD>72```7374- Omit `--port` if the server uses the default (`50000`).7576### Step 4: Save and Test Source Connection7778Call the `configure` tool with `source_connection` set to `<CONNECTION_NAME>`. The MCP server runs `scai connection test` internally and only persists the connection if the test passes.7980- **On success:** the response includes `connection_test: ok`.81- **On failure:** the tool returns an error containing the scai message. Surface it to the user, help them fix the issue, then re-run `configure(source_connection=<CONNECTION_NAME>)`.8283**Common errors:**8485| Error | Cause | Solution |86|-------|-------|----------|87| `Operation timed out` | Network / firewall | Check VPN, security groups, firewall rules |88| `SQL30081N` (communication error) | Wrong host/port or server down | Verify host, port (default `50000`), and that DB2 is listening |89| `SQL1013N` (database not found) | Wrong database name | Verify the database alias / name on the server |90| `SQL30082N` (auth failed) | Bad credentials | Re-check username and password |9192## CHECKPOINT9394Confirm with user:95- [ ] `configure` returned `connection_test: ok`96- [ ] Connection appears in `scai connection list -l db2 --json`97- [ ] Source connection saved to session config9899## On Completion100101After the CHECKPOINT passes, tell the user:102> **Connection configured** — Successfully connected to DB2 using connection `<connection_name>`.103104Then return to the calling skill.105106## Security Rules107108- **NEVER** log or display secrets (passwords) in plain text.109- **NEVER** include secrets in command-line arguments that might be logged. Prefer a credential manager (e.g. 1Password `op run`, or use /secrets capability from Cortex Code to store them).110111## Quick Reference112113| Action | Command |114|--------|---------|115| Add connection | `scai connection add-db2 -s NAME --auth standard --host HOST --port 50000 --database DB --user USER --password PASS` |116| Test connection | `configure(source_connection=NAME)` (runs the test internally) |117| List connections | `scai connection list -l db2 --json` |118| Set default | `scai connection set-default -l db2 -c NAME` |119| Extract code | `scai code extract -s NAME --json` |
Run npx skillmds@latest add snowflake-labs/db2-connection in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
DB2 Connection Skill It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
snowflake-labs (@snowflake-labs) published this skill. Their other Agent Skills are listed on their SkillMD profile.