Skip to main content
Glama
mcp-toolkit

mcp-toolkit

by Dongnb66

jwt_decode

Decode a JWT without verifying it, parse the header and payload, and check whether the token has expired; supply a secret to also verify HMAC signatures (HS256/384/512).

Instructions

解码 JWT(不验签),解析 header 与 payload 并判断是否过期;提供 secret 时用 HMAC(HS256/384/512)验签。

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
tokenYesJWT 字符串
secretNoHMAC 密钥,提供则同时验签

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does well: it discloses that signatures are NOT verified by default, that expiry is evaluated, and that verification is restricted to HMAC HS256/384/512 — implicitly signalling that RS/ES/alg=none tokens are not covered. It stops short of saying what happens on a failed verification (error vs. a boolean flag), which is the main behavioral unknown.

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?

A single, front-loaded sentence with a semicolon separating the default behavior from the conditional one. No filler, no repetition of the tool name, and the most important caveat (no signature check) appears first.

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 two-parameter tool with no annotations and no output schema, the description covers the essentials and even sketches the return surface (header, payload, expiry verdict). The remaining gap is the exact result shape when verification runs — whether success/failure is a returned field or an error — which the absent output schema leaves to the description.

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, but the description earns an extra point by explaining the semantic effect of `secret` — its presence switches the tool from decode-only to decode-plus-verify, and it constrains the accepted algorithms. That is meaning beyond the schema's terse 'HMAC key, also verifies if provided'.

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 and resource (decode a JWT) and then enumerates the concrete sub-operations: parsing header and payload, checking expiry, and optional HMAC verification. An agent immediately knows what this tool produces, and no sibling tool in the catalog (date_calc, sqlite_query, tc3_sign, etc.) overlaps with JWT decoding, so no disambiguation is required.

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 conditional usage is spelled out precisely: call without a secret for pure inspection, supply a secret to additionally verify. There are no explicit exclusions or named alternatives, but with a non-overlapping sibling set that omission costs little.

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