{"uid":"cap_nOI-pGADN2_UMWcVHTr31","slug":"api-strale-io-5a8c9f39","name":"JSDoc Comment Generator","description":"Add JSDoc comments to JavaScript/TypeScript functions and classes. Infers param types, return types, and throws.","url":"https://api.strale.io/x402/jsdoc-generate","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":["code"],"properties":{"code":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"code":"function add(x, y) { if (typeof x !== 'number' || typeof y !== 'number') throw new TypeError('Arguments must be numbers'); return x + y; }"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0xb3c5be245d4b548b6cb7a2c0b92a1b94f4225f3eedc63b59538c8af3e9d1b3cf"},"capability":"jsdoc-generate","latency_ms":1402,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-13T04:24:02.269Z"}},"tags_used":["@param","@returns","@throws","@example"],"documented_code":"/**\n * Adds two numbers together.\n * @param {number} x - The first number to add\n * @param {number} y - The second number to add\n * @returns {number} The sum of x and y\n * @throws {TypeError} If either argument is not a number\n * @example\n * add(2, 3); // returns 5\n */\nfunction add(x, y) { if (typeof x !== 'number' || typeof y !== 'number') throw new TypeError('Arguments must be numbers'); return x + y; }","functions_documented":1,"type_annotations_added":2}},"exampleRequest":{"code":"function add(x, y) { if (typeof x !== 'number' || typeof y !== 'number') throw new TypeError('Arguments must be numbers'); return x + y; }"},"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_dMTt64c8ZwPiwoy2fRFZc","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":"Automatically generates JSDoc comments for JavaScript/TypeScript functions and classes, inferring parameter types, return types, and thrown exceptions.","exampleAgentPrompt":"Can you add JSDoc comments to this JavaScript function — infer the param types, return type, and any thrown errors: `function divide(a, b) { if (b === 0) throw new Error('Division by zero'); return a / b; }`?","exampleUseCases":[{"title":"Batch document legacy codebase","prompt":"I've got a bunch of old JavaScript files that have no documentation. Can you go through them and add JSDoc comments to every function and class? Make sure you infer the parameter types, return types, and any errors they might throw."},{"title":"Auto-generate TypeScript API docs","prompt":"I need to quickly document this TypeScript API module with proper JSDoc comments. Can you add comprehensive @param, @returns, and @throws tags for all the functions, inferring the types from the code?"},{"title":"Prepare code for team review","prompt":"Before I submit this pull request, can you add JSDoc annotations to my JavaScript functions? I want the parameters, return values, and potential exceptions all clearly documented so my team understands what each function does."}],"resultDescription":"Returns the original code enhanced with JSDoc block comments including @param tags with inferred types, @returns tag with inferred return type, and @throws tags for any detected exceptions.","failureModes":["Missing 'code' query parameter returns a validation error","Unparseable or syntactically invalid code may produce incomplete or malformed JSDoc","Very large code blocks may time out or return partial results","Non-JavaScript/TypeScript input (e.g. Python) may yield nonsensical annotations"],"whenToPreferThis":"Choose this endpoint when you need to automatically document JavaScript or TypeScript code with JSDoc comments, especially when type inference for params, returns, and throws is needed without running a full TypeScript compiler or linter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:07:11.879Z","isFirstParty":false}