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).

MethodPathWhat it does
POST/api/databases/:connectionId/queryRun a query on a connection
GET/api/databases/:connectionId/schemaGet the schema tree of a connection
GET/api/databases/:connectionId/object-definitionGet the definition of a database object
POST/api/databases/:connectionId/planExplain a query
POST/api/databases/:connectionId/rowsRead every row of a query for export
POST/api/databases/:connectionId/insert-scriptWrite insert statements for result rows
POST/api/queries/executeExecute a query with the safety filter
POST/api/queries/execute-batchExecute several queries in order
POST/api/queries/run-scriptRun a script statement by statement
POST/api/queries/previewPreview how many rows a write changes
GET/api/connections/:id/databasesList the databases on a connection
GET/api/connections/:id/schemasList the schemas of a database
GET/api/connections/:id/objectsList the objects in a schema
GET/api/connections/:id/object-propertiesGet the properties of an object
GET/api/connections/:id/tables/:schema/:name/columnsList the columns of a table
GET/api/connections/:id/tables/:schema/:name/indexesList the indexes of a table
GET/api/connections/:id/tables/:schema/:name/foreign-keysList the foreign keys of a table
GET/api/connections/:id/tables/:schema/:name/constraintsList the constraints of a table
GET/api/connections/:id/tables/:schema/:name/triggersList the triggers of a table
GET/api/connections/:id/tables/:schema/:name/partitionsList the partitions of a table
GET/api/connections/:id/tables/:schema/:name/statisticsGet the statistics of a table
GET/api/connections/:id/tables/:schema/:name/grantsList the grants on a table
GET/api/connections/:id/objects/:schema/:name/definitionScript the definition of an object
GET/api/connections/:id/search-objectsSearch the objects of a connection
GET/api/connections/:id/server-infoGet the server information of a connection
GET/api/connections/:id/sessionsList the sessions on a server
GET/api/connections/:id/locksList the locks on a server
GET/api/connections/:id/usersList the users of a database server
GET/api/connections/:id/rolesList the roles of a database server
GET/api/connections/:id/tablespacesList 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
query (body)string, requiredThe statement or statements to run, in the connection's query language
database (body)string, optionalThe database to use on the connection. Defaults to the connection's own database
maxRows (body)integer, 1 or more, optionalReturn 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
type (query)string, requiredThe connection's engine, for example postgresql, mysql, mssql or mongodb
database (query)string, optionalThe 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
objectType (query)string, requiredThe object type, for example table, view, function, procedure or sequence
objectName (query)string, requiredThe object name
schemaName (query)string, optionalThe schema of the object
database (query)string, optionalThe 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
query (body)string, requiredOne statement to explain
database (body)string, optionalThe database to use on the connection. Defaults to the connection's own database
analyze (body)boolean, optionalRun 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
query (body)string, requiredThe query that reads the rows
database (body)string, optionalThe 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
query (body)string, optionalThe query that reads the rows. Send this or rows
rows (body)list of object, optionalThe rows to write. Send this or query
database (body)string, optionalThe database to use on the connection. Defaults to the connection's own database
table (body)string, requiredThe table the statements insert into
schema (body)string, optionalThe schema of the table
keyColumns (body)list of string, optionalThe 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to run on
query (body)string, requiredThe statement to run, in the connection's query language
type (body)string, optionalAccepted 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to run on
queries (body)list of string, requiredThe statements to run, in order
type (body)string, optionalAccepted 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to run on
sql (body)string, requiredThe 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to preview on
query (body)string, requiredThe write statement to preview
database (body)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
database (query)string, optionalThe database to use on the connection. Defaults to the connection's own database
schema (query)string, optionalThe schema to list. Leave it out for every schema
kinds (query)string, optionalObject 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
database (query)string, optionalThe database to use on the connection. Defaults to the connection's own database
schema (query)string, optionalThe schema of the object
name (query)string, optionalThe object name
kind (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the table. Send _ for engines without schemas
name (path)string, requiredThe table name
database (query)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
schema (path)string, requiredThe schema of the object. Send _ for engines without schemas
name (path)string, requiredThe object name
kind (query)string, optionalThe 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, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID
q (query)string, optionalThe text to look for, at least 2 characters
limit (query)integer, 1 to 500, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe connection ID