JSDoc Generator
Add JSDoc comments to JavaScript and TypeScript functions and classes, with parameter, return and thrown types.
Pay by wallet (x402) AI-generated
jsdoc-generate Example
Input
{
"code": "function hello() { return 'world'; }"
} Answer
{
"tags_used": [
"@returns"
],
"documented_code": "/**\n * Returns a greeting string.\n * @returns {string} The string 'world'.\n */\nfunction hello() { return 'world'; }",
"functions_documented": 1,
"type_annotations_added": 1
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
code | string | Yes | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
tags_used | array | Always (present in every successful answer) |
documented_code | string | Always (present in every successful answer) |
functions_documented | integer | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "jsdoc-generate",
"inputs": {
"code": "function hello() { return 'world'; }"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "jsdoc-generate",
"inputs": {
"code": "function hello() { return 'world'; }"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "jsdoc-generate",
inputs: {
"code": "function hello() { return 'world'; }"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="jsdoc-generate",
inputs={
"code": "function hello() { return 'world'; }",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/jsdoc-generate?code=function+hello%28%29+%7B+return+%27world%27%3B+%7D' Limitations
Complex types can produce incomplete annotations
AI-generated JSDoc — complex generic types or overloaded function signatures may produce incomplete type annotations
What to do instead: Validate generated JSDoc with TypeScript compiler type checking to catch annotation mismatches
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05