Skip to main content
Glama

Hash a text string

hash_text
Read-onlyIdempotent

Compute SHA-256, SHA-1, MD5, and optional SHA-512 hashes from pasted UTF-8 text to get checksums for conversation content, not files on disk.

Instructions

Hash pasted text with SHA-256, SHA-1, MD5, and optional SHA-512.

Use this when you have text in the conversation and need its checksum. The text is hashed as UTF-8 bytes. It is plain code, not an AI model, so the same text always gives the same hashes. This tool does not look the hash up in a malware list or a password list. Do not use it for a file on disk (use hash_file for files).

algorithms: a list from sha256, sha1, md5, sha512. Default is sha256, sha1 and md5. MD5 and SHA-1 are not safe for new security work; prefer SHA-256 or SHA-512 when you can.

Returns {"ok", "bytes", "encoding": "utf-8", "hashes", and a hex field for each algorithm, plus a Base64 field when include_base64 is true}.

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": {
      "text": "<text>"
    },
    "name": "hash_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to hash. It is hashed as UTF-8 bytes.
algorithmsNoHash algorithms to compute. Default: sha256, sha1, md5. SHA-512 is optional. MD5 and SHA-1 are provided because people still need them for checks; they are not safe for new security work.
include_base64NoIf true (default), each hash is returned as hex and as Base64. Hex is always included.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety profile is covered. The description adds real context beyond that: UTF-8 byte encoding, deterministic 'plain code, not an AI model' behavior, and an explicit statement that it does not consult malware or password lists. Only the exact hex casing/formatting is left unstated, which is minor.

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?

Front-loaded with purpose and usage, then parameters, then return shape — a sensible ordering. The algorithm paragraph repeats the schema somewhat, but the returns sentence earns its place because there is no output schema.

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?

No output schema exists, and the description compensates by naming the returned fields (ok, bytes, encoding, hashes, per-algorithm hex, conditional Base64). Combined with full parameter coverage and annotations, an agent has everything needed to call and interpret 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%, so the schema already documents all three parameters, including the algorithm defaults and the warning about MD5/SHA-1. The description restates the algorithm list, default set, and base64 behavior rather than adding new meaning, 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 ('Hash pasted text') plus the exact algorithm set, and immediately scopes it to text in the conversation rather than files. An agent can distinguish this from hash_file and the base64/json siblings 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 condition ('when you have text in the conversation and need its checksum'), an explicit when-not ('Do not use it for a file on disk'), and names the alternative ('use hash_file for files'). It even carves out the adjacent-but-wrong use case of looking up hashes in malware/password lists.

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