IDE endpoints
Run queries, explain and export them, and browse database objects. Paths are relative to the address of your Simcha DB Studio server.
Through the MCP server these endpoints are the IDE tool group, off until an admin turns it on.
While this group is on, the MCP server also offers the lookups its tools need: connections_list (List connections, from Connections).
| Method | Path | What it does |
|---|---|---|
| POST | /api/databases/:connectionId/query | Run a query on a connection |
| GET | /api/databases/:connectionId/schema | Get the schema tree of a connection |
| GET | /api/databases/:connectionId/object-definition | Get the definition of a database object |
| POST | /api/databases/:connectionId/plan | Explain a query |
| POST | /api/databases/:connectionId/rows | Read every row of a query for export |
| POST | /api/databases/:connectionId/insert-script | Write insert statements for result rows |
| POST | /api/queries/execute | Execute a query with the safety filter |
| POST | /api/queries/execute-batch | Execute several queries in order |
| POST | /api/queries/run-script | Run a script statement by statement |
| POST | /api/queries/preview | Preview how many rows a write changes |
| GET | /api/connections/:id/databases | List the databases on a connection |
| GET | /api/connections/:id/schemas | List the schemas of a database |
| GET | /api/connections/:id/objects | List the objects in a schema |
| GET | /api/connections/:id/object-properties | Get the properties of an object |
| GET | /api/connections/:id/tables/:schema/:name/columns | List the columns of a table |
| GET | /api/connections/:id/tables/:schema/:name/indexes | List the indexes of a table |
| GET | /api/connections/:id/tables/:schema/:name/foreign-keys | List the foreign keys of a table |
| GET | /api/connections/:id/tables/:schema/:name/constraints | List the constraints of a table |
| GET | /api/connections/:id/tables/:schema/:name/triggers | List the triggers of a table |
| GET | /api/connections/:id/tables/:schema/:name/partitions | List the partitions of a table |
| GET | /api/connections/:id/tables/:schema/:name/statistics | Get the statistics of a table |
| GET | /api/connections/:id/tables/:schema/:name/grants | List the grants on a table |
| GET | /api/connections/:id/objects/:schema/:name/definition | Script the definition of an object |
| GET | /api/connections/:id/search-objects | Search the objects of a connection |
| GET | /api/connections/:id/server-info | Get the server information of a connection |
| GET | /api/connections/:id/sessions | List the sessions on a server |
| GET | /api/connections/:id/locks | List the locks on a server |
| GET | /api/connections/:id/users | List the users of a database server |
| GET | /api/connections/:id/roles | List the roles of a database server |
| GET | /api/connections/:id/tablespaces | List the tablespaces of a server |
POST /api/databases/:connectionId/query
Runs the query text on the connection, on the database given or the connection's own, and returns the columns and rows. With maxRows only that many rows come back and the result is marked truncated with the total. Statements that write are refused on a connection marked read-only. From an API token, a dangerous statement (a drop, emptying a table, DELETE or UPDATE without WHERE, account or privilege changes, stopping the server) is refused with 400 DANGEROUS_QUERY; run it as a migration script. The per-person query rate limit applies, and the server's query size limit and timeout when they are set.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_query · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
query (body) | string, required | The statement or statements to run, in the connection's query language |
database (body) | string, optional | The database to use on the connection. Defaults to the connection's own database |
maxRows (body) | integer, 1 or more, optional | Return at most this many rows |
GET /api/databases/:connectionId/schema
Returns the tables, views, procedures and other objects of the connection's database as the engine reports them. The type must be the connection's engine.
Reads only · Role: Any signed-in user · MCP tool: ide_schema
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
type (query) | string, required | The connection's engine, for example postgresql, mysql, mssql or mongodb |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/databases/:connectionId/object-definition
Returns the definition, such as the CREATE statement, of one table, view, function or other object. Each engine supports its own object types and an unsupported type is refused. When the object does not exist, definition is null and message says so.
Reads only · Role: Any signed-in user · MCP tool: ide_object_definition
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
objectType (query) | string, required | The object type, for example table, view, function, procedure or sequence |
objectName (query) | string, required | The object name |
schemaName (query) | string, optional | The schema of the object |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
POST /api/databases/:connectionId/plan
Returns the query plan of one statement as a tree. Only the plan is read, except that Cassandra runs the SELECT to trace it and Elasticsearch runs the search to profile it. With analyze, PostgreSQL and MySQL family engines run the statement in a read-only transaction to add actual timings, and a statement that writes is refused.
Reads only · Role: Any signed-in user · MCP tool: ide_explain
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
query (body) | string, required | One statement to explain |
database (body) | string, optional | The database to use on the connection. Defaults to the connection's own database |
analyze (body) | boolean, optional | Run the statement to measure actual rows and timings. PostgreSQL and MySQL family engines only |
POST /api/databases/:connectionId/rows
Runs the query again and returns every row with no row limit, for an export. A statement that writes is refused, but the text is otherwise run as sent.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_export_rows · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
query (body) | string, required | The query that reads the rows |
database (body) | string, optional | The database to use on the connection. Defaults to the connection's own database |
POST /api/databases/:connectionId/insert-script
Returns a script, in the connection's language, that inserts the rows into the table named, and the row count. Send the rows, or a query that reads them: a query is run again on the connection and a statement that writes is refused. Nothing is inserted.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_insert_script · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
query (body) | string, optional | The query that reads the rows. Send this or rows |
rows (body) | list of object, optional | The rows to write. Send this or query |
database (body) | string, optional | The database to use on the connection. Defaults to the connection's own database |
table (body) | string, required | The table the statements insert into |
schema (body) | string, optional | The schema of the table |
keyColumns (body) | list of string, optional | The key columns. Redis uses the first column and Elasticsearch _id when this is left out |
POST /api/queries/execute
Runs the query text on the connection's own database and returns the result. A dangerous statement (a drop, emptying a table, DELETE or UPDATE without WHERE, account or privilege changes, stopping the server), judged statement by statement outside comments and quoted text, is refused with 400 DANGEROUS_QUERY, as are writes on a read-only connection. The per-user query rate limit applies, and the server's query size limit and timeout when they are set.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_execute · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to run on |
query (body) | string, required | The statement to run, in the connection's query language |
type (body) | string, optional | Accepted and ignored: the connection's own engine is used |
POST /api/queries/execute-batch
Runs each query in turn on the connection and stops at the first one that fails. Returns success and the result of each query that ran. The safety filter, read-only check and limits of ide_execute apply to every query.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_execute_batch · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to run on |
queries (body) | list of string, required | The statements to run, in order |
type (body) | string, optional | Accepted and ignored: the connection's own engine is used |
POST /api/queries/run-script
Splits the script into statements for the connection's engine and runs them one at a time, stopping at the first failure. Returns how many ran, succeeded and failed, the rows affected and each step's time. Writes are refused on a read-only connection, and the dangerous-statement check, size limit, timeout and rate limit of ide_execute apply to the whole script.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_run_script · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to run on |
sql (body) | string, required | The script, in the connection's query language |
POST /api/queries/preview
Runs an INSERT, UPDATE, DELETE or MERGE inside a transaction that is rolled back and returns the rows affected with committed false; MongoDB, Redis, Elasticsearch and Cassandra count the documents, keys or rows instead. Text that only reads returns read true without running, and other statements are refused on SQL engines. The text is run as sent, so a COMMIT inside it makes the changes permanent.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: ide_preview_write · Runs the query text on the connection
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to preview on |
query (body) | string, required | The write statement to preview |
database (body) | string, optional | The database on the connection to preview in, on PostgreSQL, MySQL, MariaDB and SQL Server. Leave it out for the connection default |
GET /api/connections/:id/databases
Lists the databases on the connection's server with their size where the engine reports it. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_databases
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/schemas
Lists the schemas with their owner, size and whether they are system schemas. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_schemas
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/objects
Lists tables, views, functions and other objects with their kind, row count and size where the engine reports them. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_objects
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
schema (query) | string, optional | The schema to list. Leave it out for every schema |
kinds (query) | string, optional | Object kinds to list, comma separated, for example table,view,function. Leave it out for every kind |
GET /api/connections/:id/object-properties
Returns the properties of one object, such as a sequence or function, with related rows and its definition where the engine has them. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_object_properties
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
schema (query) | string, optional | The schema of the object |
name (query) | string, optional | The object name |
kind (query) | string, optional | The object kind, for example sequence, function or view |
GET /api/connections/:id/tables/:schema/:name/columns
Lists the columns with type, nullability, default, comment and key, index and auto-increment flags. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_columns
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/indexes
Lists the indexes with their columns, method, uniqueness, predicate, size and scan count where reported. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_indexes
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/foreign-keys
Lists the foreign keys with their columns, the referenced table and columns, and the update and delete rules. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_foreign_keys
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/constraints
Lists the check, unique, exclusion, primary key and not null constraints with their definitions. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_constraints
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/triggers
Lists the triggers with their timing, event, level, whether they are enabled and their definition. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_triggers
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/partitions
Lists the partitions with their method, bound, size and row count. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_partitions
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/statistics
Returns the row count, table and index size, last vacuum and analyze times, dead rows and scan counts where the engine reports them. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_statistics
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/tables/:schema/:name/grants
Lists who holds which privilege on the table, or on one of its columns, whether each is granted, denied or revoked, and whether a granted privilege can be granted on. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_table_grants
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the table. Send _ for engines without schemas |
name (path) | string, required | The table name |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/objects/:schema/:name/definition
Returns the definition of a view, function, table or other object as a script, each overload of a function, aggregate or operator as its own statement. An object that does not exist is refused with 404, and a kind the engine cannot script, such as a PostgreSQL base type, with 400 and the reason. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_object_script
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
schema (path) | string, required | The schema of the object. Send _ for engines without schemas |
name (path) | string, required | The object name |
kind (query) | string, optional | The object kind as the navigator lists it, for example table, view, materialized_view, function, trigger_function, aggregate, procedure, sequence, trigger, index, type, foreign_table, collation or operator |
database (query) | string, optional | The database to use on the connection. Defaults to the connection's own database |
GET /api/connections/:id/search-objects
Finds tables, views and other objects whose name or comment contains the text, with their schema and kind. Text shorter than 2 characters returns an empty list. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_search_objects
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
q (query) | string, optional | The text to look for, at least 2 characters |
limit (query) | integer, 1 to 500, optional | The most objects to return. Default 50 |
GET /api/connections/:id/server-info
Returns the server version, uptime, whether it is a replica and its settings. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_server_info
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/sessions
Lists the open sessions with user, application, database, state, current query and age. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_sessions
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/locks
Lists the locks held or awaited, with the session, relation, mode and what each waits for. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_locks
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/users
Lists the database users with whether they can log in, are superusers and the roles they belong to. On MongoDB, a login the server does not allow to list them is refused with 403 and code NOT_PERMITTED. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_users
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/roles
Lists the database roles with their members and whether they are system roles. On MongoDB, a login the server does not allow to list them is refused with 403 and code NOT_PERMITTED. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_roles
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |
GET /api/connections/:id/tablespaces
Lists the tablespaces with owner, size, location and which is the default. Engines without this answer 501 with code CAPABILITY_NOT_SUPPORTED.
Reads only · Role: Any signed-in user · MCP tool: ide_list_tablespaces
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The connection ID |