Skip to main content
Glama

md5

Calculate MD5 hash values for strings to verify data integrity or generate checksums for security and validation purposes.

Instructions

Calculate MD5 hash of a string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe input string to hash

Implementation Reference

  • The md5 tool handler that computes the MD5 hash of the input string using the DigestUtil helper and returns it as text content.
    ({ input }) => {
      const hash = DigestUtil.md5(input);
      return {
        content: [{ type: "text", text: hash }],
      };
    }
  • Zod schema defining the input as a string for the md5 tool.
    {
      input: z.string().describe("The input string to hash"),
    },
  • Registration of the md5 tool on the McpServer.
    server.tool(
      "md5",
      "Calculate MD5 hash of a string",
      {
        input: z.string().describe("The input string to hash"),
      },
      ({ input }) => {
        const hash = DigestUtil.md5(input);
        return {
          content: [{ type: "text", text: hash }],
        };
      }
    );
  • DigestUtil.md5 static method that performs the actual MD5 hashing using CryptoJS.
    static md5(input: string): string {
      const hash = CryptoJS.MD5(input);
      return hash.toString();
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1595901624/crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server