{"uid":"cap_V3M02gEu-qWNt8g23Lcvx","slug":"sql-formatter-and-analyzer-eaf390fd","name":"SQL Formatter and Analyzer","description":"SQL formatter: upper-cases keywords, breaks the statement into SELECT/FROM/JOIN/WHERE/GROUP BY/ORDER BY clauses, one column per line, indents AND/OR, and reports the statement type, tables referenced and whether it looks like a write (INSERT/UPDATE/DELETE/DROP). Works on most ANSI SQL dialects. $0.01 per statement.","url":"https://intel.rallylive.ca/dev/sql-format","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"],"type":"string"},"queryParams":{"type":"object","properties":{}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UrvO2q2Dz2t624fM3rQI6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Formats SQL statements with standardized casing and indentation, and extracts metadata such as statement type, referenced tables, and write operation detection.","exampleAgentPrompt":"Can you format this SQL for me — uppercase the keywords, break it into proper clauses, and tell me which tables it touches and whether it's a write operation? SELECT id, name FROM users u JOIN orders o ON u.id = o.user_id WHERE o.status = 'pending'","exampleUseCases":[{"title":"Prettify a messy SQL query","prompt":"This SQL is a mess — can you format it with uppercase keywords, one column per line, and proper clause breaks? select u.id,u.name,o.total from users u join orders o on u.id=o.user_id where o.status='complete' and o.total>100 order by o.total desc"},{"title":"Detect write operations in SQL audit","prompt":"I need to check this SQL statement before running it — format it nicely and tell me if it's a write operation like INSERT, UPDATE, DELETE, or DROP, and which tables it touches: DELETE FROM sessions WHERE last_active < '2024-01-01'"},{"title":"Extract table references from a query","prompt":"Can you analyze this SQL and tell me the statement type, which tables are referenced, and whether it modifies any data? Also clean up the formatting while you're at it: select p.name, count(r.id) from products p left join reviews r on p.id=r.product_id group by p.name"}],"resultDescription":"Returns the original SQL reformatted with uppercased keywords, clause-by-clause line breaks (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY), one column per line, and indented AND/OR conditions. Also returns metadata: the detected statement type (e.g. SELECT, INSERT), a list of referenced table names, and a boolean flag indicating whether the statement appears to be a write operation.","failureModes":["Missing or empty SQL input returns an error","Highly non-standard or proprietary SQL dialects may not parse correctly","Very long or deeply nested queries may produce unexpected formatting","Query params not passed correctly result in no output","Malformed SQL may still be formatted but metadata may be incomplete or incorrect"],"whenToPreferThis":"Choose this endpoint when you need both SQL formatting and lightweight static analysis (table extraction, write-op detection) in a single call. It is ideal for developer tools, SQL review pipelines, audit workflows, and code review agents that need to make raw SQL human-readable and extract structural metadata without executing the query. Prefer it over generic code formatters that don't understand SQL clause structure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T13:07:05.681Z","isFirstParty":false}