{"uid":"cap_i3GEt8T2oaMV03fKs0O73","slug":"api-strale-io-4f723c96","name":"PR Description Generator from Diff","description":"Generate pull request descriptions from diffs or commit logs. Returns title, summary, changes list, testing steps.","url":"https://api.strale.io/x402/pr-description-generate?utm_source=zero.xyz","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":["diff"],"properties":{"diff":{"type":"string"},"title":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"diff":"diff --git a/src/utils.js b/src/utils.js\nindex 1234567..abcdefg 100644\n--- a/src/utils.js\n+++ b/src/utils.js\n@@ -10,6 +10,12 @@ function formatDate(date) {\n   return date.toISOString();\n }\n \n+function validateEmail(email) {\n+  const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n+  return emailRegex.test(email);\n+}\n+\n+module.exports.validateEmail = validateEmail;\n+\n function parseJSON(str) {\n   try {\n     return JSON.parse(str);\n","title":"Add email validation utility function"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0x7597bec621429a32cbbbc8f1e3ef17c777dd8866684e4a5ef9e12a1a8ed20524"},"capability":"pr-description-generate","latency_ms":3171,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-13T04:23:46.754Z"}},"title":"Add email validation utility function","changes":["Added `validateEmail(email)` function that uses regex pattern to validate email format","Exported `validateEmail` function from utils module","Pattern validates basic email structure: non-whitespace characters, @ symbol, domain, and TLD"],"summary":"Introduces a new `validateEmail()` utility function that validates email addresses using a regular expression pattern. The function is exported from the utils module for use across the application.","testing":["Test with valid emails: 'user@example.com', 'test.name@domain.co.uk'","Test with invalid emails: 'invalid', 'user@', '@example.com', 'user @example.com'","Verify the function returns true for valid formats and false for invalid formats"],"markdown":"## Description\nThis PR adds a new email validation utility function to the `utils` module. The function provides a simple, reusable way to validate email address formats across the application.\n\n## Changes\n- Added `validateEmail(email)` function that validates email addresses against a regex pattern\n- Exported the function from the utils module for public use\n- The regex pattern `/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/` checks for:\n  - Non-whitespace characters before @\n  - @ symbol\n  - Non-whitespace domain name\n  - Dot followed by TLD\n\n## Testing\nPlease verify the function works correctly with:\n- **Valid emails:** `user@example.com`, `test.name@domain.co.uk`\n- **Invalid emails:** `invalid`, `user@`, `@example.com`, `user @example.com`","related_issues":[],"breaking_changes":[]}},"exampleRequest":{"diff":"diff --git a/src/utils.js b/src/utils.js\nindex 1234567..abcdefg 100644\n--- a/src/utils.js\n+++ b/src/utils.js\n@@ -10,6 +10,12 @@ function formatDate(date) {\n   return date.toISOString();\n }\n \n+function validateEmail(email) {\n+  const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n+  return emailRegex.test(email);\n+}\n+\n+module.exports.validateEmail = validateEmail;\n+\n function parseJSON(str) {\n   try {\n     return JSON.parse(str);\n","title":"Add email validation utility function"},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.054001/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_FLXNEaQYUkTEUHFBI1piK","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":"Generates a structured pull request description (title, summary, changes list, testing steps) from a code diff or commit log.","exampleAgentPrompt":"Generate a pull request description from this diff: `diff --git a/src/auth.js b/src/auth.js\\n- const token = jwt.sign(payload, secret);\\n+ const token = jwt.sign(payload, secret, { expiresIn: '1h' });` — I need a title, summary, list of changes, and testing steps.","exampleUseCases":null,"resultDescription":"Returns a structured PR description including a concise title, a prose summary of what changed and why, a bullet-point list of individual changes, and step-by-step testing instructions suitable for posting directly into GitHub, GitLab, or Bitbucket.","failureModes":["Missing required 'diff' query parameter returns validation error","Empty or malformed diff string may produce vague or incomplete output","Very large diffs may time out or return truncated results","Non-code text passed as diff may yield low-quality or irrelevant descriptions"],"whenToPreferThis":"Use this endpoint when you need to automatically generate a well-structured pull request description from raw git diff output or a commit log, especially in CI/CD pipelines, developer bots, or code review automation workflows. It's ideal when developers want to skip writing PR descriptions manually and need structured output (title + summary + changes + testing steps) ready to post to a VCS platform.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:43:40.978Z","isFirstParty":false,"canonicalSlug":"api-strale-io-4f723c96"}