Skip to main content
Glama

Check a JWT: read its claims and verify it with a JWKS

jwt_decode
Read-only

Decodes a JWT (up to 16 KB): header, payload, registered claims as ISO dates, expired and not-yet-valid flags, algorithm and signature length. With jwksUrl (public https) the signature is checked with WebCrypto for RS, PS and ES algorithms against the matching key. 'none' is never accepted; HMAC needs the secret. Tokens are secrets: this tool does not store or log them. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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": {
      "token": "<token>"
    },
    "name": "jwt_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesThe JWT, three base64url parts separated by dots (up to 16 KB)
jwksUrlNoPublic https URL of the JWKS to verify with (optional)

Output Schema

NameRequiredDescriptionDefault
kidNo
typeNo
claimsNo
headerNo
sourceNo
expiredNo
payloadNo
verifiedNo
algorithmNo
checkedAtNo
notYetValidNo
signatureBytesNo
verifiedReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses the 16 KB size cap, that 'none' algorithms are rejected, that RS/PS/ES are verified via WebCrypto against the matching key, that tokens are not stored or logged, and the pricing model ($0.002 per successful call via x402, failed calls free). These are exactly the operational facts an agent needs 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?

It is a single dense paragraph that front-loads the core decode behavior and return fields before moving to verification, safety, and price. Every sentence carries information, though the pricing/network enumeration is verbose enough to slightly dilute scannability.

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 two-parameter read tool with an output schema, the description covers the inputs, the verification behavior, security handling of the token, and cost. Nothing material needed to call it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3; the description adds real meaning by constraining jwksUrl to a public https URL and explaining that it triggers WebCrypto verification for RS/PS/ES keys. The only soft spot is 'HMAC needs the secret' with no corresponding secret parameter in the schema, which leaves that path slightly ambiguous.

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 specific verb and resource ('Decodes a JWT') and enumerates exactly what is returned: header, payload, registered claims as ISO dates, expiry flags, algorithm and signature length. It also distinguishes the two modes (decode-only vs. signature verification with jwksUrl), so an agent knows precisely what this tool does.

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?

It gives a clear conditional: pass jwksUrl (public https) to have the signature checked; without it the token is only decoded. It also states negative rules ('none' is never accepted; HMAC needs the secret), which steer correct invocation. It does not name a sibling alternative or an explicit 'use this instead when...' exclusion, so it stops short of a 5.

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