Jwt Sign
jwt_signCreate or verify HMAC-signed JWTs (HS256 / HS384 / HS512) — for test fixtures, service-to-service tokens, webhook auth and debugging "invalid signature" errors. sign: builds header + claims with iat / exp / nbf from durations ("15m", "1h", "7d"), iss / sub / aud shortcuts and an optional random jti, and returns the compact token. verify: checks the signature in constant time plus exp / nbf / iat with leeway and optional issuer / audience expectations, and explains exactly why a token fails. The secret can be UTF-8, base64, base64url or hex; it is never echoed or stored. Warns when the secret is shorter than the hash (RFC 7518 §3.2). For RS / ES / EdDSA token decoding and JWKS verification use /v1/jwt-decode. Price: $0.002 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/jwt-sign
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"secret": "<secret>"
},
"name": "jwt_sign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alg | No | HS256 | |
| iat | No | sign: add iat | |
| jti | No | sign: add a random jti (UUID v4) | |
| now | No | Unix time to treat as "now" (default: server time) | |
| mode | No | sign | |
| token | No | verify: the compact JWT | |
| claims | No | sign: payload claims (JSON object) | |
| header | No | sign: extra header fields, e.g. {"kid": "k1"} | |
| issuer | No | ||
| leeway | No | verify: clock-skew allowance in seconds | |
| secret | Yes | HMAC secret (never echoed) | |
| subject | No | ||
| audience | No | ||
| expiresIn | No | sign: exp = now + duration ("900", "15m", "1h", "7d") | |
| notBefore | No | sign: nbf = now + duration | |
| secretEncoding | No | utf8 |