{"name":"io.github.S-CurveLabs/sqlglass","slug":"s-curvelabs-sqlglass","title":"sqlglass","description":"SQL Server / Azure SQL for agents: real schema, lint, read-only runs, plans, write previews.","url":"https://mcp.market/server/s-curvelabs-sqlglass","rating":null,"grade":"C","score":65,"certified":false,"status":"active","category":"data","tags":["data"],"presence":{"score":16,"stars":0,"forks":0,"downloads_week":13,"last_push_at":"2026-09-22T03:15:10.000Z","license":"MIT"},"uptime":null,"claimed":false,"transport":"pypi","callable_via_gateway":false,"default_price_micros":0,"repository":"https://github.com/S-CurveLabs/sqlglass","website":null,"version":"0.1.0","remotes":[],"packages":[{"registryType":"pypi","identifier":"sqlglass","version":"0.1.0","transport":{"type":"stdio"},"environmentVariables":[{"description":"Path to sqlglass.toml (connection definitions). Optional if the file is in the workspace or the user data folder.","name":"SQLGLASS_CONFIG"}]}],"tools":[{"name":"analyze_sql","description":"What a query touches: tables/views, columns per table, CTEs, parameters and its output columns.","write_action":false,"price_micros":0,"input_schema":null},{"name":"build_create_table","description":"Generate a CREATE TABLE script (TEXT ONLY -- this server never runs DDL; the user reviews and runs it). Checked against the cached schema: the name must be free, foreign keys must point at a real primary/unique key with the same column types, FK columns get an index, constraints get conventional names, and the script is wrapped in IF OBJECT_ID(...) IS NULL so it can be re-run. Returns sql + undo_s","write_action":true,"price_micros":0,"input_schema":null},{"name":"build_procedure","description":"Generate a CREATE OR ALTER PROCEDURE script (TEXT ONLY -- never executed here) around a query. Give inline 'sql', or a library 'query' -- then its header params (name, type, default) become the procedure's parameters automatically. Every @variable in the body must be a typed parameter. params: [{\"name\": \"@StartDate\", \"type\": \"date\", \"default\": \"'2026-01-01'\", \"description\": \"first order date\"}] Re","write_action":false,"price_micros":0,"input_schema":null},{"name":"build_select","description":"Generate a SELECT from the cached schema: names validated, joins inferred from foreign keys (bridge tables added automatically), aliases assigned, GROUP BY derived. Returns SQL text only; nothing is executed.","write_action":false,"price_micros":0,"input_schema":null},{"name":"build_view","description":"Generate a CREATE OR ALTER VIEW script (TEXT ONLY -- never executed here) from a SELECT or a library query. Refuses what a view cannot contain: parameters, DECLARE, ORDER BY without TOP.","write_action":false,"price_micros":0,"input_schema":null},{"name":"delete_query","description":"Remove a query from the library. Its text is kept in a snapshot, so restore_snapshot brings it back.","write_action":true,"price_micros":0,"input_schema":null},{"name":"describe_table","description":"Columns (type, nullability, identity/computed), primary key, indexes, foreign keys in both directions and row count of one table or view. Always do this before writing SQL against a table.","write_action":false,"price_micros":0,"input_schema":null},{"name":"explain_query","description":"Estimated execution plan, summarised: the expensive operators, scans on big tables, key lookups, sorts, implicit conversions, optimizer warnings and missing-index suggestions. The query is compiled, NOT executed, so this is safe on heavy queries. (SQL Server login needs the SHOWPLAN permission.)","write_action":false,"price_micros":0,"input_schema":null},{"name":"extract_parameter","description":"Turn a hard-coded value in a saved query into a parameter: every occurrence of the literal ('2026-01-01', 100) becomes @param, and a '-- param:' header line is added with the old value as its default.","write_action":false,"price_micros":0,"input_schema":null},{"name":"find_join_path","description":"How two tables relate: the shortest chain of declared foreign keys between them, as ready-to-use JOIN lines.","write_action":false,"price_micros":0,"input_schema":null},{"name":"find_usage","description":"Impact analysis: which saved queries read a given table/view (and optionally a given column of it). Ask this before a table or column is changed, renamed or retired.","write_action":false,"price_micros":0,"input_schema":null},{"name":"format_sql","description":"Pretty-print T-SQL in one canonical style. Normalises cosmetics (adds AS to aliases, rewrites '[x] = expr' aliases to 'expr AS [x]'); meaning is unchanged. Comments inside expressions may move.","write_action":false,"price_micros":0,"input_schema":null},{"name":"get_query","description":"One saved query: header fields, parameters, the SQL, what tables it touches, and lint findings.","write_action":false,"price_micros":0,"input_schema":null},{"name":"lint_library","description":"Lint every saved query (against each query's cached connection schema when available). Catches queries broken by a schema change: run it after refresh_schema.","write_action":false,"price_micros":0,"input_schema":null},{"name":"lint_sql","description":"Check a query for correctness traps (NOT IN + NULLs, LEFT JOIN turned INNER by WHERE, join without ON, TOP without ORDER BY), performance problems (functions on filtered columns, SELECT *, NOLOCK, leading-wildcard LIKE) and style. With a connection whose schema is cached, also verifies every table and column exists.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_connections","description":"List the configured database connections (from sqlglass.toml), which is the default, where the query library lives, and whether each connection has a cached schema.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_queries","description":"Browse the saved-query library. 'search' matches id, name, description and the SQL text; 'tag' filters by tag.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_snapshots","description":"Before-images taken automatically ahead of every library write, newest first.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_tables","description":"List tables and views with row counts and descriptions. Filter by schema name and/or a name pattern ('*invoice*'). For a big database prefer search_schema.","write_action":false,"price_micros":0,"input_schema":null},{"name":"preview_write","description":"Dry-run a write WITHOUT writing: converts one UPDATE / DELETE / INSERT into the read-only SELECT that shows what it would do, plus a COUNT(*) of affected rows. The write statement itself is never sent to the database. UPDATE -> key columns + each SET column as '[col (current)]' / '[col (new)]' (changed_only=true hides no-op rows) DELETE -> the rows that would be removed (and which child tables ref","write_action":true,"price_micros":0,"input_schema":null},{"name":"profile_table","description":"Per-column row count, NULLs, distinct values, min and max, in one aggregate query. Use it to learn a column's grain and range before filtering or joining on it. Up to 15 columns per call.","write_action":false,"price_micros":0,"input_schema":null},{"name":"refresh_schema","description":"Re-read tables, views, columns, keys, indexes and foreign keys from the database into the local cache. Run this when a table or column seems to be missing, or after the database changed.","write_action":false,"price_micros":0,"input_schema":null},{"name":"rename_in_library","description":"Follow a database rename through every saved query, token-aware (strings and comments untouched). kind='table': old='dbo.Vendor', new='dbo.Supplier' kind='column': table='dbo.Vendor', old='Name', new='VendorName' (alias-qualified references, and bare ones in single-table queries; ambiguous bare references are reported, not changed). dry_run defaults to TRUE: review the diff, then call again with d","write_action":false,"price_micros":0,"input_schema":null},{"name":"restore_snapshot","description":"Put the queries in a snapshot back to how they were before that write ('latest' = undo the last write). The restore is itself snapshotted, so it can be undone too.","write_action":true,"price_micros":0,"input_schema":null},{"name":"run_query","description":"Run a read-only query and return the first rows. Give either inline 'sql' or a library 'query' (id or name). params: {\"@Start\": \"2026-01-01\"}; library queries fall back to their header defaults. Anything but SELECT/WITH is refused before reaching the database. Rows are capped at the connection's max_rows (lower it with max_rows=); to look at big data, aggregate in SQL.","write_action":true,"price_micros":0,"input_schema":null},{"name":"sample_table","description":"A few rows of a table or view, to see what the values actually look like.","write_action":false,"price_micros":0,"input_schema":null},{"name":"save_query","description":"Save a query to the library as <id>.sql (id may contain folders: 'purchasing/open-pos-by-vendor'). sql is the body only -- do not DECLARE the parameters in it; describe them in params: [{\"name\": \"@Start\", \"type\": \"date\", \"default\": \"'2026-01-01'\", \"description\": \"first order date\"}] Updating an existing query needs overwrite=true; header fields left empty keep their current value. kind='script' st","write_action":false,"price_micros":0,"input_schema":null},{"name":"search_schema","description":"Find tables and columns whose name contains the text (or matches a * ? wildcard pattern), plus tables whose description mentions it. The way to locate data in an unfamiliar database.","write_action":false,"price_micros":0,"input_schema":null},{"name":"translate_sql","description":"Translate a query between dialects (tsql, postgres, mysql, sqlite, snowflake, bigquery, databricks, oracle, duckdb, redshift): TOP<->LIMIT, ISNULL/COALESCE, GETDATE, DATEADD, string functions, quoting.","write_action":false,"price_micros":0,"input_schema":null}],"scan":{"score":65,"grade":"C","scanned_at":"2026-11-01T18:07:49.537Z","report":{"scannerVersion":"0.1.10","scannedAt":"2026-11-01T18:07:49.487Z","components":{"code":{"score":25,"max":25,"notes":["24 source files scanned"]},"reliability":{"score":-1,"max":20,"notes":["no gateway calls yet and no remote to probe"]},"poisoning":{"score":-1,"max":15,"notes":["tools not inspected (local package is not executed); not counted"]},"auth":{"score":12,"max":15,"notes":["local package, no credentials required"]},"maintenance":{"score":3,"max":15,"notes":["repository not readable: repo not found"]},"identity":{"score":2,"max":10,"notes":["no repository or website to verify"]}},"findings":[],"inputs":{"packages":[{"registryType":"pypi","identifier":"sqlglass","version":"0.1.0","found":true,"weeklyDownloads":13,"license":"MIT","dependencyCount":6,"publishedAt":"2026-09-22T03:16:28.519664Z","repositoryUrl":"https://github.com/S-CurveLabs/sqlglass"}],"repo":{"found":false,"owner":"S-CurveLabs","repo":"sqlglass","error":"repo not found"},"icon":{"url":null,"source":"none"},"presence":{"stars":0,"forks":0,"downloadsWeek":13,"license":"MIT","lastPushAt":"2026-09-22T03:15:10.000Z","score":16}}}},"grade_history":[{"kind":"downgrade","fromGrade":"A","toGrade":"C","reason":"score 65","createdAt":"2026-11-01T18:07:50.176Z"}],"reviews":[]}