Skip to main content
Glama

jwt_decode

Decode a JWT's header and payload (base64url + JSON, no crypto). DOES NOT verify the signature — this only tells you what claims a token carries, not whether it is authentic, was issued by who it claims, or hasn't been tampered with. Never treat a successful decode as validation. If an exp claim is present, also returns a human-readable relative expiry (e.g. "expires in 2 hours" or "expired 3 days ago").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesThe raw JWT string (header.payload.signature, or header.payload).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral disclosure burden, and it delivers. It reveals that no cryptographic verification occurs, explains the security implications, and additionally documents the relative-expiry behavior when an exp claim exists. This gives the agent an accurate model of what the tool can and cannot be trusted to do.

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

Conciseness5/5

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

The description is compact and front-loaded: the core action comes first, the critical limitation is emphasized immediately after, and the extra expiry behavior is a short final sentence. Every sentence contributes meaningful information with no repetition of schema content.

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?

For a one-parameter, no-output-schema tool, the description covers the main purpose, the key security caveat, and one notable extra behavior. It does not specify the exact shape of the returned header and payload or behavior on malformed tokens, but it is sufficient for an agent to understand what the tool does and when to reach for it.

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?

The input schema already documents the single token parameter at 100% coverage, including the accepted format. The description does not add much parameter-specific detail beyond saying the token carries claims, so the baseline score of 3 applies.

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 names a specific verb ('Decode'), a specific resource ('a JWT's header and payload'), and a clear scope ('base64url + JSON, no crypto'). It also explicitly distinguishes itself from verification by stating it does not verify the signature, which helps an agent tell it apart from sibling tools like verify and cert_inspect.

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?

The description makes the intended use clear: decode a JWT to see what claims it carries. It also gives an explicit when-not-to-use warning ('Never treat a successful decode as validation'), which guides the agent away from using it for authentication or integrity checks. It does not name the specific alternative tool to use instead, but the exclusion is strong and actionable.

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