hash_bcrypt
Generate bcrypt hashes for secure password storage by converting input strings into encrypted formats with configurable salt rounds.
Instructions
Generate a bcrypt hash of the given input string. Useful for password hashing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The string to hash | |
| rounds | No | Number of salt rounds (4-16, default: 10) |
Implementation Reference
- src/tools/hash.ts:68-87 (handler)Implementation of the 'hash_bcrypt' tool, including its registration, input validation schema, and the handler function that generates the bcrypt hash.
server.tool( "hash_bcrypt", "Generate a bcrypt hash of the given input string. Useful for password hashing.", { input: z.string().describe("The string to hash"), rounds: z .number() .int() .min(4) .max(16) .default(10) .describe("Number of salt rounds (4-16, default: 10)"), }, async ({ input, rounds }) => { const hash = await bcrypt.hash(input, rounds); return { content: [{ type: "text" as const, text: hash }], }; } );