Skip to main content
Glama
paladini

devutils-mcp-server

generate_random_hex

Generate random hexadecimal strings for development needs like unique identifiers, cryptographic keys, or test data by specifying byte length.

Instructions

Generate a random hexadecimal string of the specified byte length.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesNoNumber of random bytes (output will be 2x this length in hex)

Implementation Reference

  • Handler for generate_random_hex, using randomBytes to generate the hex string.
    async ({ bytes }) => ({
      content: [
        { type: "text" as const, text: randomBytes(bytes).toString("hex") },
      ],
  • Zod schema defining the input for generate_random_hex.
    {
      bytes: z
        .number()
        .int()
        .min(1)
        .max(256)
        .default(16)
        .describe("Number of random bytes (output will be 2x this length in hex)"),
    },
  • Registration of the generate_random_hex tool on the MCP server.
    server.tool(
      "generate_random_hex",
      "Generate a random hexadecimal string of the specified byte length.",
      {
        bytes: z
          .number()
          .int()
          .min(1)
          .max(256)
          .default(16)
          .describe("Number of random bytes (output will be 2x this length in hex)"),
      },

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/paladini/devutils-mcp-server'

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