{"uid":"cap_yvRhYSgnX28vhr_zyj-th","slug":"strale-sql-explain-5c3668d2","name":"Strale SQL Explain","description":"The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.","url":"https://api.strale.io/x402/v2/sql-explain","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["sql"],"properties":{"sql":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.054","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.054/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SxgA8IZgKFiuXnEsYsG5W","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Explains a SQL query in plain language, identifying tables, joins, filters, aggregations, and potential issues","exampleAgentPrompt":"Can you explain what this SQL query does in plain English — I need to understand the tables it's joining, any filters it applies, and what it's aggregating: SELECT o.order_id, c.name, SUM(oi.price) FROM orders o JOIN customers c ON o.customer_id = c.id JOIN order_items oi ON o.order_id = oi.order_id WHERE o.status = 'shipped' GROUP BY o.order_id, c.name?","exampleUseCases":[{"title":"Onboarding to unfamiliar codebase","prompt":"I just inherited a codebase and I'm trying to understand this gnarly query — can you explain it in plain English, including what tables it touches and what it's filtering on: SELECT u.id, u.email, COUNT(s.id) as sub_count FROM users u LEFT JOIN subscriptions s ON s.user_id = u.id WHERE s.status = 'active' AND u.created_at > '2023-01-01' GROUP BY u.id, u.email HAVING COUNT(s.id) > 2?"},{"title":"Debugging unexpected query results","prompt":"My query is returning weird numbers and I can't figure out why — can you explain exactly what this SQL is doing step by step, especially the joins and aggregations: SELECT p.product_name, SUM(oi.quantity * oi.unit_price) AS revenue FROM products p JOIN order_items oi ON oi.product_id = p.id JOIN orders o ON o.id = oi.order_id WHERE o.created_at BETWEEN '2024-01-01' AND '2024-03-31' GROUP BY p.product_name ORDER BY revenue DESC?"},{"title":"Reviewing a junior developer's query","prompt":"A junior dev submitted this SQL and I need to quickly review it — can you explain in plain language what it does and flag any potential problems or inefficiencies: SELECT * FROM invoices i, payments p WHERE i.id = p.invoice_id AND i.due_date < NOW() AND p.amount < i.total_amount?"}],"resultDescription":"Returns a structured plain-language breakdown of the SQL query including: identification of all referenced tables, explanation of join logic and conditions, description of WHERE filters and their meaning, explanation of aggregations and GROUP BY clauses, ORDER BY and LIMIT context, and flagged potential issues such as implicit joins, missing indexes, or logic errors. Each call is accompanied by a cryptographic audit record.","failureModes":["Missing or empty 'sql' query parameter returns validation error","Malformed or syntactically invalid SQL may return parsing error or limited explanation","Extremely long or deeply nested queries may produce incomplete analysis","Non-standard SQL dialects (e.g. proprietary database syntax) may not be fully interpreted","Payment not fulfilled results in 402 response blocking access"],"whenToPreferThis":"Choose this endpoint when you need a reliable, auditable plain-language explanation of a SQL query — especially useful for developer tools, code review automation, onboarding assistants, or database documentation pipelines. The cryptographic audit trail makes it suitable for compliance-sensitive environments. Prefer this over general-purpose LLM SQL explanation when you need structured, consistent output with verifiable provenance across 250+ tested capabilities on the Strale platform.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:31.176Z","isFirstParty":false}