hash_bcrypt_verify
Verify if a plain text string matches a bcrypt hash for secure password validation. Returns true on successful match.
Instructions
Verify a string against a bcrypt hash. Returns true if matches.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The plain text string | |
| hash | Yes | The bcrypt hash to verify against |
Implementation Reference
- src/tools/hash.ts:90-108 (handler)The tool 'hash_bcrypt_verify' is registered and implemented within 'src/tools/hash.ts'. It uses 'bcrypt.compare' to verify the input against a hash.
server.tool( "hash_bcrypt_verify", "Verify a string against a bcrypt hash. Returns true if matches.", { input: z.string().describe("The plain text string"), hash: z.string().describe("The bcrypt hash to verify against"), }, async ({ input, hash }) => { const isMatch = await bcrypt.compare(input, hash); return { content: [ { type: "text" as const, text: JSON.stringify({ match: isMatch }), }, ], }; } );