25trust / 100

Sql Explain

by Aayat AI in Developer tools

x402 APIFailing, checked 2 h ago

Explain and sanity-check a SQL query before running it: statement type, tables touched, syntax problems (quotes, parentheses, = NULL), risky patterns (UPDATE/DELETE without WHERE, DROP, NOT IN with NULLs, cartesian joins, non-sargable filters, multiple statements) and a plain-English explanation. POST {sql, dialect}.

POST https://aayatai.com/sql/explain

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
6.7%
Response time
591 ms typical, 591 ms slowest 5%
Last check
2 h ago: Expected HTTP 402, got 410
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://aayatai.com/sql/explain" \
  -H "content-type: application/json" \
  -d '{"dialect":"postgres","sql":"DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Faayatai.com%2Fsql%2Fexplain
const res = await pay("https://aayatai.com/sql/explain", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"dialect":"postgres","sql":"DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"}),
});
console.log(await res.json());

Example input

{
  "dialect": "postgres",
  "sql": "DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"
}

Example output

{
  "explanation": "Deletes every user whose last login was more than two years ago.",
  "findings": [],
  "statements": 1,
  "tables": [
    "users"
  ],
  "type": "DELETE",
  "valid": true,
  "verdict": "ok"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoExpected HTTP 402, got 41041039 ms-
6 h agoExpected HTTP 402, got 410410138 ms-
11 h agoExpected HTTP 402, got 41041045 ms-
15 h agoExpected HTTP 402, got 41041037 ms-
19 h agoExpected HTTP 402, got 41041036 ms-
23 h agoExpected HTTP 402, got 41041033 ms-
27 h agoExpected HTTP 402, got 41041034 ms-
31 h agoExpected HTTP 402, got 410410134 ms-
35 h agoExpected HTTP 402, got 41041061 ms-
40 h agoExpected HTTP 402, got 41041046 ms-
43 h agoExpected HTTP 402, got 41041037 ms-
2 days agoExpected HTTP 402, got 41041033 ms-
2 days agoExpected HTTP 402, got 41041098 ms-
2 days agoExpected HTTP 402, got 41041038 ms-
2 days agoPassed402591 ms$0.003