Skip to main content
Glama

Hash a local file

hash_file
Read-onlyIdempotent

Compute SHA-256, SHA-1, MD5, and optional SHA-512 hashes from a local file's raw bytes without pasting or modifying it; reads files up to 5 MB and returns hex and Base64 values.

Instructions

Hash a local file's raw bytes with SHA-256, SHA-1, MD5, and optional SHA-512.

Use this when the data is in a file on this computer, so you don't have to paste it. The file is only read, never changed. Files larger than 5 MB are rejected; use the Apify version for bigger jobs. This tool does not look the hash up in a malware list or a password list.

path: full path to a file, up to 5 MB. 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", "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": {
      "path": "<path>"
    },
    "name": "hash_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFull path to a local file, up to 5 MB. The raw file bytes are hashed, not a decoded string.
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.6/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the bar is low; the description still adds substantive behavior: the file is opened read-only and never mutated, a 5 MB hard limit exists, and no external lookup occurs. It also states the return shape, which no output schema supplies.

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 routing before parameter detail, then ends with the return shape; every block is scannable. The path/algorithms lines largely duplicate schema text, so a small amount of space is not strictly earning its place.

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?

There is no output schema, but the description spells out the returned fields (ok, bytes, per-algorithm hex, Base64 when include_base64 is true), covering the only structural gap. For a three-parameter read-only hashing tool nothing an agent needs is missing.

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%, so path, algorithms and include_base64 are all documented structurally. The description restates the same defaults and enum values plus a safety note on MD5/SHA-1, adding emphasis but no format or syntax beyond the schema — baseline 3 is correct.

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?

Specific verb and resource: hashes a local file's raw bytes with named algorithms (SHA-256, SHA-1, MD5, optional SHA-512). The clause 'use this when the data is in a file on this computer, so you don't have to paste it' distinguishes it from the sibling hash_text without ambiguity.

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?

Explicit when-to-use (data is in a local file rather than pasted text), explicit when-not (files over 5 MB are rejected, redirected to another version), and explicit scope exclusions (no malware-list or password-list lookup). That is full routing guidance rather than implied usage.

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