Skip to main content
The IBM i MCP Server’s SQL Tools system allows you to create powerful database operations using simple YAML configurations. Define SQL queries in YAML files, and the server automatically converts them into AI-accessible tools with parameter validation, security controls, and response formatting. No TypeScript required - SQL professionals can build sophisticated IBM i tools using familiar SQL syntax and simple YAML structure.

Pre-Built Tool Categories

The tools/ directory contains pre-built tool configurations organized by category:
List Available Toolsets:

Build Tools with an AI Assistant

The IBM i MCP tool builder is an Agent Skill for AI coding assistants such as Claude Code and IBM Bob. You describe the tool you want, and the assistant follows the skill’s steps:
  1. Find the right Db2 for i SQL service and check every table and column name on your system.
  2. Test the SQL live, with read-only statements only.
  3. Write the YAML tool file.
  4. Validate it with the bundled validator.
  5. Give you the command that starts the server with the new tools.

Install the skill

The command asks which coding assistant to install the skill for. To install it by hand, copy the skills/ibmi-mcp-tool-builder folder into the skills folder of your assistant:

Use the skill

Ask your assistant for a tool in plain words, for example: “Build a tool that lists the active jobs of a user, highest CPU first.” The assistant loads the skill when the request is about IBM i MCP SQL tools.
  • Testing the SQL works best in IBM Bob’s IBM i Developer mode (Premium Package for i). Without it, the skill uses the ibmi CLI or an IBM i MCP Server started with --builtin-tools --execute-sql.
  • The validator needs Node.js 20 or later. On first use the assistant installs its two packages (ajv, js-yaml) in the skill’s scripts/ folder.
  • The skill writes new files to tools-tmp/ unless you name another place.
The validator checks the same schema the server uses, plus parameter bindings, tool and toolset references, write statements without readOnly: false, and that each source has a password or an SSH key. Run it yourself on any tools file: node <skill folder>/scripts/validate-tools.mjs tools/.

YAML File Format

SQL tools are defined in YAML files with three main sections:

Sources

Database connectionsDefine IBM i system connections with credentials, ports, and connection optionsSources Reference →

Tools

SQL operationsIndividual queries with parameters, validation, and security controlsTools Reference →

Toolsets

Logical groupsOrganize related tools for discovery and selective loadingToolsets Reference →

Basic Structure

Why YAML? Separating SQL definitions from application code enables SQL professionals to build and maintain tools without TypeScript knowledge while ensuring security through parameter validation and prepared statements.

Key Concepts

Sources - Database Connections

Define reusable connection configurations with environment variables for security:
Key features:
  • Environment variable substitution for credentials
  • Multiple environment support (dev, test, prod)
  • Connection pooling and timeouts
  • SSL/TLS configuration

Complete Sources Reference

Learn about all source configuration options, security best practices, and troubleshooting →

Tools - SQL Operations

Individual SQL queries with parameter validation and security controls:
Parameter types:
  • String - Pattern validation, length constraints, enums
  • Integer - Range validation, defaults
  • Float - Decimal numbers for calculations
  • Boolean - True/false flags
  • Array - Lists of values for IN clauses

Complete Tools Reference

Explore all tool configuration options, parameter types, security features, and examples →

Toolsets - Logical Organization

Group related tools for discovery and selective loading:
Organization strategies:
  • By functional domain (monitoring, security, reporting)
  • By business process (onboarding, payroll, inventory)
  • By user role (developer, DBA, auditor)
  • By environment (production, development, testing)

Complete Toolsets Reference

Learn about toolset organization, selective loading, and best practices →

Security & Validation

Automatic Security

  • SQL Injection Protection - All parameters use prepared statements
  • Type Validation - Parameters validated against defined schemas
  • IBM i Authorities - Queries respect object-level permissions
  • Audit Logging - Optional detailed execution logs

Security Configuration

Mark sensitive tools for enhanced protection:

Loading and Configuration

Load Specific Toolsets

Environment Variables


Complete Example

A simple but complete YAML configuration:
Complete Examples: See the Building SQL Tools guide for the comprehensive employee-info.yaml example that demonstrates all parameter types and SQL patterns in a production-ready configuration.

Next Steps

Sources Reference

Database connection configuration

Tools Reference

SQL tool definitions and parameters

Toolsets Reference

Organizing tools into groups

Building SQL Tools

Step-by-step guide with complete examples

Configuration Guide

Server configuration and environment variables
Design Philosophy: YAML SQL tools democratize AI agent development for IBM i environments. SQL professionals build sophisticated tools using familiar SQL syntax, while the MCP server handles AI integration, security, parameter validation, and protocol management automatically.