sqlike-mcp
v0.2.11Lints 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…
| Parameter | Type | Description |
|---|---|---|
sql * | string | The SQL query to analyze. |
dialect | string | null | SQL dialect: "postgres" (default), "mysql", "sqlite", "mssql", "mariadb", or "duckdb". |
explain | string | null | Optional 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… |
schema | string | null | Optional schema DDL (CREATE TABLE / CREATE INDEX) for column- and type-aware checks. |
stats | string | null | Optional 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…
| Parameter | Type | Description |
|---|---|---|
sql_a * | string | The original query. |
sql_b * | string | The rewritten query to check for equivalence against `sql_a`. |
columns | string | null | How 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). |
dialect | string | null | SQL dialect: "postgres" (default), "mysql", "sqlite", "mssql", "mariadb", or "duckdb". |
ignore | string | 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. |
schema | string | null | Optional schema DDL both queries resolve against. There is one schema, because a comparison over two different schemas has no defined answer. |