Official Schema: See the JSON Schema definition for the authoritative tool configuration specification.
Tool Structure
Every tool definition follows this structure:Required Fields
All SQL tools must include these fields:| Field | Type | Description |
|---|---|---|
tool_name | string (YAML key) | Unique identifier for the tool, used by AI agents to call it |
source | string | Name of the database connection source (from sources section) |
description | string | Clear explanation of what the tool does, for AI agent consumption |
statement | string | SQL query to execute when the tool is called |
Field Details
- tool_name
- source
- description
- statement
Unique identifier for the toolThe tool name is the YAML key and must be unique across all tools.Naming conventions:
- Use lowercase with underscores:
get_active_jobs - Be descriptive:
find_employees_by_departmentnotemp_search - Prefix by domain if needed:
perf_system_status,sec_audit_trail
Parameters
Parameters define dynamic inputs for SQL tools. Each parameter specifies type, validation rules, and usage information.Complete Parameter Guide
See the full Parameter Guide for detailed examples of all parameter types, validation patterns, and best practices for building SQL tools with parameters.
Parameter Structure
Parameter Types
- String
- Integer
- Float
- Boolean
- Array
Text values with validationValidation options:
pattern- Regular expression for validationminLength- Minimum string lengthmaxLength- Maximum string lengthenum- Fixed list of allowed valuesdefault- Default value if not provided
Optional Parameters
Parameters withoutrequired: true or with default values are optional:
Security Configuration
Add security controls to tools for enhanced protection:Security Fields
| Field | Type | Default | Description |
|---|---|---|---|
readOnly | boolean | true | Restrict to read-only operations (SELECT queries) |
maxQueryLength | number | 10000 | Maximum SQL query length in characters |
forbiddenKeywords | array | [] | Additional forbidden SQL keywords beyond defaults |
- readOnly
- maxQueryLength
- forbiddenKeywords
Mark tools as read-only (SELECT queries only):Default:
Best Practice: Mark all tools that don’t modify data as
readOnly: true. This provides clear documentation and can be used for access control.true (for safety - tools are read-only by default)Response Formatting
Control how tool results are formatted for AI agents:responseFormat
Type:string
Options: json (default), markdown
- json - Structured data (default, best for AI processing)
- markdown - Formatted text with markdown syntax
Metadata
Add descriptive metadata for tool organization and discovery:Metadata Fields
title
title
Human-readable title for the tool
version
version
Semantic version for tracking tool changes
author
author
keywords
keywords
Search keywords for tool discovery
lastUpdated
lastUpdated
Date of last modification (ISO format)
domain
domain
Business domain classification (monitoring, security, business, etc.)
category
category
Functional category within domain
environment
environment
Target environment (production, development, testing)
Complete Tool Examples
Simple Query (No Parameters)
String Parameter with Validation
Multiple Parameters with Different Types
Tool with Security Configuration
Array Parameter Tool
Best Practices
SQL Statement Design
SQL Statement Design
Optimization:
- Always include
FETCH FIRST n ROWS ONLYto limit results - Use
LEFT JOINinstead ofINNER JOINwhen relationships are optional - Add
ORDER BYfor consistent result ordering - Use column aliases for better AI understanding
Parameter Validation
Parameter Validation
Always validate:
- String patterns for IBM i names:
^[A-Z][A-Z0-9_]*$ - String lengths:
maxLength: 10for library names - Integer ranges:
minimum: 1, maximum: 1000 - Required vs optional: Mark appropriately
Description Quality
Description Quality
Write for AI agents:
- Be specific about what data is returned
- Mention any special authority requirements
- Include parameter examples in descriptions
- Note any result limits or performance considerations
Security Considerations
Security Considerations
Mark sensitive tools:
- Set
audit: truefor all tools accessing user data - Use
readOnly: truefor SELECT-only operations - Document required authorities in
security.requiredAuthority - Add warnings for potentially destructive operations
Next Steps
Sources Reference
Configure database connection sources
Toolsets Reference
Organize tools into logical groups
Building SQL Tools
Step-by-step guide with examples
Parameter Validation
Deep dive into validation rules
Tool Design Philosophy: Effective tools are discoverable (clear names and descriptions), safe (proper validation and security), and performant (optimized SQL with result limits). Write tools for AI agent consumption, not just human readability.