sqlike-mcp

v0.2.11
io.github.orifisher2/sqlike-mcp Checked 5 hours ago Published 3 days ago

Lints SQL and checks rewrites return the same rows.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

analyze

Use when you write, edit, or review a SQL query and want it checked before it runs. Returns SQLike's deterministic analysis as JSON: validity errors, anti-patterns, rewrites, and schema and index advice. Optional inputs: schema DDL for column and type checks, table row counts (stats) so severity follows volume, an EXPLAIN plan so index findings are confirmed or dismissed by what the planner did, and dialect (postgres by default, mysql, mariadb, sqlite, mssql, duckdb). DuckDB is columnar, so its severities and index advice differ. The query is tokenized on the machine before it is sent: identif…

ParameterTypeDescription
sql *stringThe SQL query to analyze.
dialectstring | nullSQL dialect: "postgres" (default), "mysql", "sqlite", "mssql", "mariadb", or "duckdb".
explainstring | nullOptional query plan, to confirm or dismiss missing-index findings by what the planner actually did and, with actual row counts, re-score every performance finding: Postgres `EXPLAIN (ANALYZE, FORMAT J…
schemastring | nullOptional schema DDL (CREATE TABLE / CREATE INDEX) for column- and type-aware checks.
statsstring | nullOptional table row counts as a JSON map, e.g. `{"orders": 2000000}`. Severity scales with volume: a large table promotes a performance finding, a small one demotes it and drops index advice. Table nam…

diff

Use to check that two SQL queries are equivalent, whenever you rewrite, refactor, or optimize a query and need to know it still returns the same results. Reading the two queries does not prove that. Returns SQLike's deterministic verdict as JSON: an overall result (Equivalent, EquivalentWithNotes, Differs, Undecided or NotComparable), a confidence level, and a report per property (columns, rows, cardinality, order). Undecided does not mean equivalent. If one query is invalid (a missing table or column, an ambiguous reference) the pair is Differs, because a query that does not run cannot return…

ParameterTypeDescription
sql_a *stringThe original query.
sql_b *stringThe rewritten query to check for equivalence against `sql_a`.
columnsstring | nullHow the result's columns are read: "by_position" (default, the SQL standard: the columns in order) or "by_name" (for code that fetches columns by name, where a reorder is only a note).
dialectstring | nullSQL dialect: "postgres" (default), "mysql", "sqlite", "mssql", "mariadb", or "duckdb".
ignorestring | null"order" when the caller does not depend on the order the rows arrive in: two queries that sort differently are then a note rather than undecided.
schemastring | nullOptional schema DDL both queries resolve against. There is one schema, because a comparison over two different schemas has no defined answer.