DataPilot

v0.2.0
io.github.mqfarooqi1/datapilot-mcp Checked 2 days ago Published 2 days ago

Read-only SQL exploration, schema discovery and data profiling for SQLite and PostgreSQL

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

connect_database Connect database

Open a SQLite file or PostgreSQL database, then discover its schema. Use only for a new or replacement connection. An existing alias is replaced. SQLite paths are resolved on the server host. For PostgreSQL use a dedicated read-only role and pass the password's environment variable name, never its value. Non-local hosts require operator opt-in. Returns connection details, database version, whether a test write was refused, schema and generated-tool counts. The write probe is a diagnostic. Use list_connections to find existing aliases.

ParameterTypeDescription
database *stringSQLite file on the server host, or PostgreSQL database name.
aliasstringConnection name. Reusing it replaces that connection.
backendstring'sqlite' or 'postgresql'
hostPostgreSQL hostname. Defaults to localhost.
password_envServer environment variable name holding the PostgreSQL password.
portPostgreSQL port. Defaults to 5432.
sslmodePostgreSQL TLS mode, e.g. verify-full. Optional.
usernamePostgreSQL role name. Use a dedicated read-only role.

list_connections List connections

List open database connections and their aliases without opening a connection or querying a database. Returns connection metadata without password values, count, and the default alias when exactly one connection is open. Use before passing an explicit alias to schema or query tools.

disconnect_database Disconnect database

Close the connection identified by alias, discard its cached schema, and remove the generated tools for that alias. Keeps the database and the other connections. Returns the closed alias. Use list_connections to select an open connection.

ParameterTypeDescription
alias *stringOpen connection alias from list_connections.

get_database_overview Get database overview

Summarize the discovered schema for one connection: table, view and foreign-key counts, largest tables, and discovery time. Use this first to gauge scope, then list_tables for individual names or describe_relationships for join keys. Uses cached metadata. Call refresh_schema after a migration.

ParameterTypeDescription
aliasAlias from list_connections. Omit only when exactly one database is open.

list_tables List tables

Find tables and views in the discovered schema before choosing one to inspect. Returns qualified names, kind, primary keys, approximate row counts, and column counts. Use describe_table for column details or get_database_overview for totals.

ParameterTypeDescription
aliasAlias from list_connections. Omit only when exactly one database is open.
patternCase-insensitive glob on the qualified name, e.g. public.sales_*.

describe_table Describe table

Full detail for one table: every column with its type, nullability and default; the primary key; declared foreign keys; indexes; and unique constraints. Use before querying an unfamiliar table. Use get_table_sample for row values or describe_relationships for the database-wide join map.

ParameterTypeDescription
table *stringTable or view name from list_tables, e.g. public.orders.
aliasAlias from list_connections. Omit only when exactly one database is open.

describe_relationships Describe relationships

Return declared foreign-key edges and their join columns across the discovered schema, plus the edge count and tables without a detected relationship. Use this before a join. Use describe_table for specific column and key details.

ParameterTypeDescription
aliasAlias from list_connections. Omit only when exactly one database is open.

get_table_sample Get table sample

Preview a small number of rows from a named table or view, even when no per-table sample tool exists. Returns columns, rows, and the returned row count. Order is unspecified. Use profile_table for quality statistics or execute_readonly_query for a filtered, ordered, or aggregate result.

ParameterTypeDescription
table *stringTable or view name from list_tables, e.g. public.orders.
aliasAlias from list_connections. Omit only when exactly one database is open.
limitintegerRequested sample rows, subject to the server's row cap.

execute_readonly_query Execute read-only SQL query

Run one validated read-only SQL statement in the connected database's dialect. Use this for joins, aggregations, or queries without a generated tool. Bind values through parameters with :name placeholders. Returns columns, rows, returned row count and truncation; narrow or aggregate a truncated result. Policy refusals return an error and reason. Call explain_sql_policy for the rules.

ParameterTypeDescription
sql *stringOne read query, e.g. SELECT or WITH ... SELECT.
aliasAlias from list_connections. Omit only when exactly one database is open.
max_rowsintegerRequested rows, subject to the server cap.
parametersBind values by placeholder name without the colon, e.g. {'id': 7}.

profile_table Profile table

Statistics for a table, computed in the database rather than by reading rows: null counts, distinct counts, min/max, mean and standard deviation for numeric columns, the most common values, and a list of data-quality findings such as mostly-null or constant columns and missing primary keys. Each finding carries evidence. Use get_table_sample to see row values. On large or wide tables, profile only the columns you need.

ParameterTypeDescription
table *stringTable or view name from list_tables, e.g. public.orders.
aliasAlias from list_connections. Omit only when exactly one database is open.
columnsExact column names from describe_table. Omit to profile all columns.

refresh_schema Refresh schema

Re-discover the schema for an open connection after tables, views or columns change. Replaces that connection's cached schema and generated tools, then returns the new overview and generated-tool counts. Use get_database_overview to read the current cache.

ParameterTypeDescription
aliasAlias from list_connections. Omit only when exactly one database is open.

explain_sql_policy Explain SQL policy

Read the SQL validation policy without connecting to a database. Returns accepted statement categories, rejected constructs and functions, and enforcement layers. Use after a policy refusal to choose a supported read query, or before submitting unfamiliar SQL.