Skip to main content
Glama

JWT decode

jwt_decode
Read-onlyIdempotent

Decode a JSON Web Token to inspect its header, payload, timestamps, and validity status; optionally verify HS256/384/512 signatures with a secret.

Instructions

Decode a JSON Web Token (a leading "Bearer " is fine): header, payload, iat/nbf/exp/auth_time as ISO dates with relative time, expired / not-yet-valid status, and named standard claims. If "secret" is given, verifies HS256/HS384/HS512 signatures (secret as text or Base64URL). RS/ES/PS tokens are decoded but not verified (needs a public key). Encrypted JWE tokens can't be read. Web version: https://s3eidat.github.io/jwt-inspector/

Input Schema

NameRequiredDescriptionDefault
nowNoUnix time in seconds to judge expiry against. Default: now.
tokenYesThe JWT (header.payload.signature).
secretNoHMAC secret to verify an HS256/384/512 signature.
secretIsBase64NoThe secret is Base64/Base64URL-encoded bytes, not text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-open-world, but the description adds substantial independent behavior: a leading "Bearer " prefix is tolerated, epochs are rendered as ISO dates with relative time, expired/not-yet-valid status is reported, and signature verification only covers HS* algorithms. The JWE and asymmetric-key limitations are exactly the failure modes an agent needs to know before calling.

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?

Four dense sentences, front-loaded with the core action and followed by verification scope and hard limits; every clause carries information. The trailing web-version URL is the one element that doesn't help tool selection.

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 read-only 4-parameter decoder with no output schema, the description covers inputs, the shape of the returned data (dates, status flags, named claims), algorithm coverage, and unsupported token types. Nothing an agent needs to call it correctly or interpret failure is missing.

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 100%, so the documented behavior of token, now, secret and secretIsBase64 is already in structured fields; the description's note that the secret may be "text or Base64URL" largely restates the secretIsBase64 parameter. The 'now' parameter (used to judge expiry) is never mentioned in the description, so no meaningful semantics are added beyond the schema.

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?

Opens with a specific verb+resource ("Decode a JSON Web Token") and immediately enumerates what the decode yields: header, payload, ISO-converted time claims, validity status and named standard claims. No sibling tool (base64_decode, hash_compute, crypto_text_decrypt) overlaps, so an agent can route unambiguously.

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?

Clear conditions for the verification path ("If \"secret\" is given, verifies HS256/HS384/HS512") and explicit exclusions (RS/ES/PS decoded but not verified; JWE unreadable), which tells the agent when this tool will under-deliver. It names no alternative tool for asymmetric verification, so it stops short of full routing guidance.

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

Deploy Server

Other Tools