The SQL Automation Plugin provides an intelligent workflow for executing SQL Server queries through a structured, deterministic process.
It combines:
- A Node.js tool (
sql-runner) to execute SQL Server queries - An agent to orchestrate behavior
- A workflow skill to validate inputs, run queries, and interpret results
- A slash command to trigger the workflow quickly
- Input validation for SQL text and connection selection
- Optional dry-run mode (no execution, just summary)
- Parameterized queries to reduce injection risk
- Structured results: status, rows, rowCount, errorMessage
- Clear error reporting and conservative behavior
manifest.json– declares the agent, skill, tool, and slash commandagents/sql-automation-agent.agent– orchestrates the workflowskills/sql-workflow-automation.skill– defines the workflow stepstools/sql-runner/– Node.js SQL Server execution toolsql/placeholder.sql– example SQL scriptslash-commands/run-sql-workflow.json– slash command entrypoint
-
Copy the
sql-automation-plugin.v1folder into your plugins/extensions directory. -
Install Node.js (LTS recommended).
-
In
tools/sql-runner, install dependencies:npm install
-
Configure your SQL Server connection via environment variables (see Configuration). Configuration The sql-runner tool uses environment variables for connection details: • SQLRUNNER_DEFAULT_CONNECTION – name of the default connection (e.g. main) • SQLRUNNER_MAIN_SERVER – SQL Server host • SQLRUNNER_MAIN_DATABASE – database name • SQLRUNNER_MAIN_USER – username • SQLRUNNER_MAIN_PASSWORD – password You can add more connections by extending the connection map in index.js.
- Ensure the host environment loads this plugin’s manifest.json.
- Use the slash command /run-sql-workflow (or equivalent UI) with: ◦ connectionName ◦ sqlText ◦ Optional parameters ◦ Optional dryRun
- Validate inputs
- Optionally perform a dry run (no execution)
- Execute the SQL via sql-runner
- Return structured results
• /run-sql-workflow Runs the sql-workflow-automation skill with the provided parameters. Safety & Limitations • Designed to be conservative: no schema-changing queries should be run unless explicitly intended. • Always review SQL before execution. • Ensure least-privilege database accounts. • Logging is minimal by default; extend as needed for your environment.