/api/agent

POST /api/agent/v1/execute-sql

Changed on

Execute a raw SQL query against a database. Returns rows + column metadata.

Requires the user to have native-query permission on the target database; the QP middleware enforces this. The instance-level mcp-execute-sql-enabled setting must also be on (it is by default).

post/api/agent/v1/execute-sql

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Request body

database_idinteger required

value must be an integer greater than zero.

sqlstring required

value must be a non-blank string.

Response

Successful response

errorstring
row_countinteger
running_timeinteger
status'completed' | 'failed' required

Changes