{"uid":"cap_z99FTuOwniAcV1SS9fZQD","slug":"coco-sql-formatter-0bb0b349","name":"CoCo SQL Formatter","description":"Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.","url":"https://cocoeatsai.com/area4/agent/tools/sql-format?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input","output"],"properties":{"input":{"type":"object","required":["type","method","queryParams"],"properties":{"type":{"const":"http"},"method":{"enum":["GET"]},"queryParams":{"type":"object","properties":{"sql":{"type":"string"},"keyword_case":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type","example"],"properties":{"type":{"const":"json"},"example":{"type":"object","required":["formatted"],"properties":{"formatted":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"formatted":"SELECT 1","statements":1},"exampleNote":"Computed offline with demonstration inputs; time/random values are illustrative."},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MOZcuBpjBuyg9l4S2XNcP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Formats raw SQL queries into clean, readable SQL with optional keyword casing control","exampleAgentPrompt":"Can you format this SQL query so it's readable and has uppercase keywords: 'select id, name from users where active=1 and created_at > '2024-01-01' order by name'?","exampleUseCases":[{"title":"Prettify messy SQL before code review","prompt":"I have this gnarly SQL query I wrote in a hurry — can you format it nicely with uppercase keywords before I submit my pull request? Here it is: 'select u.id, u.name, count(o.id) from users u left join orders o on u.id=o.user_id where u.active=1 group by u.id, u.name'"},{"title":"Standardize SQL in documentation","prompt":"I'm writing developer docs and I need all my SQL examples consistently formatted with lowercase keywords — can you reformat this query: 'SELECT * FROM products WHERE price > 100 AND stock > 0 ORDER BY price DESC LIMIT 10'?"},{"title":"Debug complex query by reformatting","prompt":"This SQL is a nightmare to read, can you pretty-print it so I can figure out what's going on: 'select a.id,b.name,c.total from accounts a inner join billing b on a.id=b.account_id inner join (select account_id,sum(amount) as total from transactions group by account_id) c on a.id=c.account_id where a.status='active''?"}],"resultDescription":"Returns a JSON object with a 'formatted' field containing the prettified SQL string, and a 'statements' field indicating how many SQL statements were found and formatted in the input.","failureModes":["Invalid or unparseable SQL input may return an error or unformatted output","Missing required 'sql' query parameter results in a bad request","Unsupported keyword_case values may be ignored or cause errors","Very long SQL queries may time out or be truncated"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-call SQL formatting service without setting up local tooling. Ideal for AI agents that dynamically generate or process SQL and need to present it in a human-readable form, or when standardizing keyword casing across a codebase on the fly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:43:39.660Z","isFirstParty":false,"canonicalSlug":"coco-sql-formatter-0bb0b349"}