Skip to main content
Glama

Hash Encoding Direct Credits

HMAC-SHA256

hmac_sha256
Destructive

Authenticate a UTF-8 message with a UTF-8 secret key using HMAC-SHA256. Use this when you need keyed integrity/authentication with a shared secret; use hash_sha256 instead for an unkeyed checksum or fingerprint. Returns the 32-byte HMAC as 64 lowercase hexadecimal characters. Costs 1 credit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesSecret key interpreted as UTF-8 text, maximum 1,024 characters. Do not pass a hex/base64 key unless those literal characters are the intended key bytes.
messageYesMessage interpreted as UTF-8 text, maximum 65,536 characters.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / key / description
      Added value: +"Secret key interpreted as UTF-8 text, maximum 1,024 characters. Do not pass a hex/base64 key unless those literal characters are the intended key bytes."
    • addedInput schema / properties / message / description
      Added value: +"Message interpreted as UTF-8 text, maximum 65,536 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"
      +        },
      +        "hmacSha256": {
      +          "description": "HMAC-SHA256 digest encoded as 64 lowercase hexadecimal characters.",
      +          "pattern": "^[0-9a-f]{64}$",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "hmacSha256",
      +        "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

A4.5/5.0
Behavior4/5

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

Adds real context beyond the structured fields: output encoding (64 lowercase hex chars representing 32 bytes) and the 1-credit cost, which matters for a metered service. It does not, however, reconcile the annotations' destructiveHint=true / idempotentHint=false with what is described as a pure, deterministic computation, so one behavioral question is left unanswered.

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?

Three tight sentences: operation first, disambiguation second, return format and cost last. Every sentence carries distinct, decision-relevant information with no filler.

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?

An output schema exists, so return-value structure need not be spelled out, yet the description still gives the practical result shape and the credit cost. For a two-parameter crypto utility this is everything an agent needs to call it correctly.

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 description coverage is 100% and both parameters are fully documented there (UTF-8 interpretation, max lengths). The description's mention of UTF-8 key/message largely restates the schema, so it neither adds meaning nor compensates for a gap; 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 (authenticate) plus the exact resource/algorithm (HMAC-SHA256 over a UTF-8 message with a UTF-8 key), and explicitly differentiates itself from the sibling hash_sha256. An agent can pick this tool without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use rule (keyed integrity/authentication with a shared secret) and names the alternative with the condition that selects it (hash_sha256 for an unkeyed checksum or fingerprint). No inference required.

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