Sezzlee SQL Server

v0.2.1
io.github.sezzlee/mssql Checked 8 hours ago Published 1 month ago

Explore and query Microsoft SQL Server read-only: catalogue search, schema and bounded queries.

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

describe_connection

Report which database this server is connected to, what the connection may do, and the limits every other tool is bound by. Takes no arguments and never returns credentials.

search_catalog

Find the tables and views this connection can read by concept rather than by exact name: the query is matched against schema, object and column names and against whatever descriptions the catalogue carries, and each result says which of them matched. Leave query empty to page through the catalogue instead. Start here — the names it returns are the ones describe_table and run_query accept.

ParameterTypeDescription
cursorstringnextCursor from a previous search with the same query, schema, namePattern and includeViews, to continue its results.
includeViewsbooleanInclude views as well as tables, default true.
maxResultsintegerMaximum objects returned, default 50.
namePatternstringKeep only objects whose name matches this LIKE pattern: % stands for any run of characters and _ for one. Case- and accent-insensitive.
querystringWords describing what you are looking for, such as customer orders. Matched against names and descriptions, ignoring case and accents. Omit to list every object.
refreshbooleanRead the catalogue again instead of using the cached copy, default false. Use it after a schema change; it invalidates earlier cursors.
schemastringKeep only objects in this schema. Case-insensitive.

describe_table

Report one table's columns with their types and nullability, plus its primary, unique and foreign keys. Read this before writing a query against the table.

ParameterTypeDescription
schema *stringSchema of the table, as search_catalog returned it.
table *stringName of the table or view, as search_catalog returned it.

run_query

Run one read-only SQL statement and return its rows. Writes are refused. The response is capped and there is no cursor, so walk a large result by adding your own ordering and paging clause; a truncated response says which clause this engine uses.

ParameterTypeDescription
sql *stringOne read-only statement in this engine's SQL dialect. A statement that writes, or more than one statement, is refused.
maxRowsintegerMaximum rows returned. Defaults to defaultRows from describe_connection. A longer result is cut and says so.
timeoutMsintegerDeadline for the statement in milliseconds; the server cancels it when the deadline passes. Defaults to queryTimeoutMs from describe_connection.