Skip to main content
Glama

ScorpTech x402 Tools

Jwt Sign

jwt_sign
Read-onlyIdempotent

Create 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. Returns JSON with: mode, token, header, payload, alg, issuedAt, expiresAt, notBefore. Price: $0.002 USDC per successful call (x402, Base or 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

NameRequiredDescriptionDefault
algNoHS256
iatNosign: add iat
jtiNosign: add a random jti (UUID v4)
nowNoUnix time to treat as "now" (default: server time)
modeNosign
tokenNoverify: the compact JWT
claimsNosign: payload claims (JSON object)
headerNosign: extra header fields, e.g. {"kid": "k1"}
issuerNo
leewayNoverify: clock-skew allowance in seconds
secretYesHMAC secret (never echoed)
subjectNo
audienceNo
expiresInNosign: exp = now + duration ("900", "15m", "1h", "7d")
notBeforeNosign: nbf = now + duration
secretEncodingNoutf8

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new behavior: constant-time signature comparison, exp/nbf/iat checking with leeway, RFC 7518 §3.2 weak-secret warning, and the assurance that the secret is never echoed or stored. It does not contradict readOnlyHint (the operation is a pure computation producing a token). Minor gap: it doesn't state failure/error shapes beyond "explains why a token fails".

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is dense but front-loaded: purpose, mode behaviors, secret handling, sibling routing, then return shape. The pricing and duplicate HTTPS endpoint sentence are useful for an x402 tool but sit at the tail and add bulk; overall wording is efficient with little redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 16-parameter, dual-mode tool with no output schema, the description covers mode semantics, duration formats, secret encodings, verification expectations, and even enumerates returned fields (mode, token, header, payload, alg, issuedAt, expiresAt, notBefore). An agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 16 parameters at 63% schema coverage, the description materially compensates: it explains duration syntax for expiresIn/notBefore ("15m", "1h", "7d"), the iss/sub/aud shortcut mapping, optional random jti, leeway semantics, and the four secret encodings. It leaves a few params (now, mode, header) to the schema, so it is strong but not exhaustive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource ("Create or verify HMAC-signed JWTs") and enumerates the exact algorithms (HS256/HS384/HS512). It also names the sibling it is not (jwt_decode) for RS/ES/EdDSA and JWKS, so an agent can distinguish the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It lists concrete when-to-use scenarios (test fixtures, service-to-service tokens, webhook auth, debugging "invalid signature") and gives an explicit exclusion rule routing asymmetric/JWKS work to /v1/jwt-decode. The sign-vs-verify split is spelled out per mode.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources