All skills
sanjay3290 avatar

/mssql

@eab1642

Execute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.

Use this Skill: https://skilld.dev/gh/sanjay3290/ai-skills/mssql

This session only. Nothing lands on disk.

README.md

≈519 tokens on demand. Your agent reads this file only when SKILL.md points to it.

mssql

Read-only Microsoft SQL Server query skill. Query multiple databases safely with write protection.

Setup

  1. Copy the example config:
cp connections.example.json connections.json
  1. Add your database credentials:
{
  "databases": [
    {
      "name": "prod",
      "description": "Production - users, orders, transactions",
      "host": "db.example.com",
      "port": 1433,
      "database": "app_prod",
      "user": "readonly",
      "password": "secret",
      "encrypt": true,
      "tds_version": "7.3"
    }
  ]
}
  1. Secure the config:
chmod 600 connections.json

Usage

# List configured databases
python3 scripts/query.py --list

# List tables
python3 scripts/query.py --db prod --tables

# Show schema
python3 scripts/query.py --db prod --schema

# Run query (MSSQL uses TOP instead of LIMIT)
python3 scripts/query.py --db prod --query "SELECT TOP 10 * FROM users"

# Or use --limit flag (auto-converts to TOP N)
python3 scripts/query.py --db prod --query "SELECT * FROM users" --limit 100

Config Fields

Field Required Default Description
name Yes - Database identifier
description Yes - What data it contains (for auto-selection)
host Yes - Hostname
port No 1433 Port
database Yes - Database name
user Yes - Username
password Yes - Password
encrypt No false Enable TLS encryption
tds_version No auto TDS protocol version (7.0, 7.1, 7.2, 7.3, 7.4)

Safety Features

  • Read-only transaction: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED for read-only access
  • Query validation: Only SELECT, SHOW, EXPLAIN, WITH, SP_HELP allowed
  • Single statement: No multi-statement queries (prevents SELECT 1; DROP TABLE)
  • Timeouts: 30s query timeout, 10s login timeout
  • Memory cap: Max 10,000 rows per query
  • Credential protection: Passwords sanitized from error messages

Requirements

pip install pymssql

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a read-only Microsoft SQL Server interface with robust safety features, including query validation to block write operations, row limits, and credential sanitization. It presents a low risk of indirect prompt injection if data retrieved from a database contains malicious instructions.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

Signed by skilld at eab1642. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 7 months ago
metadata
{
  "author": "sanjay3290",
  "version": "1.0"
}

README badge

README badge for sanjay3290/ai-skills/mssql