Skip to main content
Glama

x402 Toolbox

Decode a JWT and check its times; optionally verify an HS256/384/512 signature

jwt_decode
Read-onlyIdempotent

Decode a JWT and check its times; optionally verify an HS256/384/512 signature. Decodes header and payload, converts exp/iat/nbf to ISO dates, reports whether the token is expired or not yet valid, and flags alg=none. If a shared secret is given, verifies HMAC signatures (HS256/384/512) in constant time. Secrets are not stored or logged. Price: $0.003 USDC per call via x402 (eip155:8453).

Input Schema

NameRequiredDescriptionDefault
tokenYes
secretNoOptional HMAC secret to verify the signature
secretEncodingNoutf8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Adds substantial behavior beyond the readOnly/idempotent annotations: converts exp/iat/nbf to ISO dates, reports expired or not-yet-valid, flags alg=none, verifies in constant time, and states secrets are not stored or logged. Pricing via x402 is also disclosed. No contradiction with annotations.

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?

Three tight, front-loaded sentences covering core behavior, optional verification, security, and pricing. Slight redundancy with the title's wording, but every sentence carries information.

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

Completeness4/5

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

No output schema exists, so the description must describe results; it does so reasonably (decoded header/payload, ISO dates, validity flags, alg=none, verification result implied). It does not specify output shape or malformed-token error behavior, but is adequate for a simple decode tool.

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

Parameters3/5

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

Schema coverage is only 33% (only 'secret' is described in the schema). The description clarifies the secret parameter's purpose and supported algorithms, but never explains 'secretEncoding' (utf8/base64/hex) or the token format/length expectations, leaving a meaningful gap.

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?

States a specific verb and resource ('Decode a JWT') plus the full scope: time checks and optional HMAC verification. An agent can tell exactly what this does and that it is not a general HMAC tool like the sibling 'hmac'.

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

Usage Guidelines4/5

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

Gives a clear condition for the optional path: 'If a shared secret is given, verifies HMAC signatures'. Implies usage for inspecting tokens and choosing secret only when verification is needed, but does not explicitly name alternatives or exclusions.

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.