reverse_word
Reverse the characters in any word to create its mirror image. This tool transforms input text by flipping character order for various applications.
Instructions
Reverses the characters in a given word
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| word | Yes | The word to reverse |
Implementation Reference
- src/server.ts:90-92 (handler)Core handler function executing the reverse_word tool logic: splits the word into characters, reverses the array, and joins back into a string.private reverseWord(word: string): string { return word.split("").reverse().join(""); }
- src/server.ts:12-14 (schema)Zod schema for validating input to the reverse_word tool, requiring a 'word' string.const ReverseWordSchema = z.object({ word: z.string().describe("The word to reverse"), });
- src/server.ts:39-52 (registration)Registration of the reverse_word tool in the ListToolsRequestHandler, including name, description, and input schema.{ name: "reverse_word", description: "Reverses the characters in a given word", inputSchema: { type: "object", properties: { word: { type: "string", description: "The word to reverse", }, }, required: ["word"], }, } as Tool,
- src/sse-server.ts:93-95 (handler)Core handler function executing the reverse_word tool logic: splits the word into characters, reverses the array, and joins back into a string (SSE variant).private reverseWord(word: string): string { return word.split("").reverse().join(""); }
- src/sse-server.ts:13-15 (schema)Zod schema for validating input to the reverse_word tool, requiring a 'word' string (SSE variant).const ReverseWordSchema = z.object({ word: z.string().describe("The word to reverse"), });