Skip to main content
Glama

Hash Encoding Direct Credits

JWT decode

jwt_decode
Destructive

Decode a compact JWT's header and payload for inspection without verifying its signature. Use this for debugging or reading claims only; never treat the returned claims as authenticated or trusted. The response always reports signatureVerified=false, even when a signature segment is present. Costs 1 credit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesCompact JWT string in header.payload.signature form, maximum 8,192 characters.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / token / description
      Added value: +"Compact JWT string in header.payload.signature form, maximum 8,192 characters."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "creditsRemaining": {
      +          "description": "Credits remaining after this successful 1-credit call.",
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "header": {
      +          "description": "Decoded JWT header JSON value."
      +        },
      +        "payload": {
      +          "description": "Decoded JWT payload JSON value."
      +        },
      +        "signaturePresent": {
      +          "description": "Whether the compact JWT included a non-empty signature segment.",
      +          "type": "boolean"
      +        },
      +        "signatureVerified": {
      +          "const": false,
      +          "description": "Always false: this tool does not verify JWT signatures.",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "header",
      +        "payload",
      +        "signaturePresent",
      +        "signatureVerified",
      +        "creditsRemaining"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "creditsRemaining": {
      +          "anyOf": [
      +            {
      +              "maximum": 9007199254740991,
      +              "minimum": 0,
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Known remaining credits, or null when no balance can be reported."
      +        },
      +        "error": {
      +          "description": "Human-readable reason the protected tool call failed.",
      +          "type": "string"
      +        },
      +        "status": {
      +          "description": "HTTP-style status code for the failure.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "error",
      +        "status",
      +        "creditsRemaining"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.7/5.0
Behavior2/5

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

The description discloses genuinely useful behavior beyond the schema: it never verifies the signature, always reports signatureVerified=false even when a signature segment exists, and costs 1 credit. However, it depicts a pure inspection/read operation while annotations declare readOnlyHint=false and destructiveHint=true, leaving the agent with two conflicting signals about whether the call mutates anything.

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 short sentences, front-loaded with the verb and immediately followed by the usage/trust caveat, then the behavioral guarantee and cost. The only mild redundancy is 'for debugging or reading claims only' overlapping the first sentence's 'for inspection'.

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?

An output schema exists, so return shape need not be explained, and the description still adds the trust caveat, the signatureVerified=false guarantee, and credit cost. The one hole is that it never reconciles its read-only framing with the destructive/readOnly annotations, leaving an agent unsure about side effects.

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% and the single token parameter already documents the required header.payload.signature form and the 8,192-character limit. The description adds no new parameter semantics (e.g., handling of unpadded or encrypted JWTs), so the baseline 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?

States a specific verb and resource ('Decode a compact JWT's header and payload') plus the critical scope qualifier 'without verifying its signature'. This cleanly separates it from sibling base64_decode, which does not understand JWT structure or emit signature status.

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?

'Use this for debugging or reading claims only' gives a clear use context and a hard exclusion ('never treat the returned claims as authenticated or trusted'), which is exactly the guidance needed for a security-sensitive decoder. It does not, however, name an alternative sibling (e.g., base64_decode) for non-JWT payloads.

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