SQL Explainer
Explain a SQL query in plain English: tables, joins, filters, aggregations and likely performance problems.
Pay by wallet (x402) AI-generated
sql-explain Example
Example answer
{
"steps": [
"Parser encounters the word 'test'",
"No SQL keywords (SELECT, INSERT, UPDATE, DELETE, CREATE, etc.) are recognized",
"Query fails to parse and returns a syntax error"
],
"dialect": "postgres",
"sql_length": 4,
"explanation": "The input 'test' is not a valid SQL query. It appears to be a plain text string with no SQL syntax or commands.",
"potential_issues": [
"Invalid SQL syntax - not a valid SQL statement",
"Query will fail execution with a PostgreSQL syntax error"
],
"tables_referenced": [],
"optimization_suggestions": [
"Provide a valid SQL query to analyze",
"Ensure the query contains proper SQL syntax with keywords like SELECT, INSERT, UPDATE, or DELETE"
]
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
sql | string | Yes | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
tables | array | Always (present in every successful answer) |
operations | array | Always (present in every successful answer) |
plain_english | string | Always (present in every successful answer) |
potential_issues | array | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "sql-explain",
"inputs": {
"sql": "SELECT * FROM users WHERE active = true LIMIT 10"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "sql-explain",
"inputs": {
"sql": "SELECT * FROM users WHERE active = true LIMIT 10"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "sql-explain",
inputs: {
"sql": "SELECT * FROM users WHERE active = true LIMIT 10"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="sql-explain",
inputs={
"sql": "SELECT * FROM users WHERE active = true LIMIT 10",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/sql-explain?sql=SELECT+*+FROM+users+WHERE+active+%3D+true+LIMIT+10' Limitations
Performance depends on the database and its data
AI explanation of SQL queries — performance implications depend on your specific database engine, indexes, and data distribution
What to do instead: Run EXPLAIN ANALYZE on your database to compare the actual execution plan with the explanation.
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05