Tools · Services

sql

Changes things

Query a SQL database. Reads by default; set allow_writes=True to enable mutations.

When to use: Use when the user's question is answered by rows in a relational database. Explore with list_tables / describe_table first if the schema is unknown.

Example

The call

tool call
{
  "tool": "sql",
  "arguments": {
    "action": "query",
    "sql": "SELECT region, SUM(amount) FROM orders GROUP BY region"
  }
}

Needs pip install 'shipit-agent[sql]' and a database URL

So it isn't run here, and no output is shown: nothing on this page is made up.

Parameters

NameTypeDescription
action*stringWhat to do: query (SELECT), execute (mutate; requires allow_writes=True), list_tables, describe_table, schema_summary.queryexecutelist_tablesdescribe_tableschema_summary
sqlstringSQL statement. Required for action=query and action=execute. Prefer :named parameters over concatenation.
paramsobjectNamed parameters substituted into :name placeholders.
tablestringTable name (required for action=describe_table).
schemastringOptional schema/database qualifier for describe_table.
limitintegerCap for action=schema_summary (default 50).

* required

Work in GitHub, Slack, Jira, Linear, Notion, Google, Stripe and more.