reverse_string
Reverse the order of characters in any input string to create a mirrored version for text manipulation or data processing tasks.
Instructions
입력된 문자열을 뒤집어서 반환합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 뒤집을 문자열 |
Implementation Reference
- src/tools.ts:143-149 (handler)Core handler function that reverses the input string using split-reverse-join and returns both original and reversed strings.export function reverseString(text: string): ReverseResult { const reversed = text.split("").reverse().join(""); return { original: text, reversed, }; }
- src/tools.ts:138-141 (schema)TypeScript interface defining the output schema for the reverse_string tool.export interface ReverseResult { original: string; reversed: string; }
- src/index.ts:218-236 (registration)Registers the 'reverse_string' tool with the MCP server, including input schema validation using Zod and handler invocation.server.tool( "reverse_string", "입력된 문자열을 뒤집어서 반환합니다.", { text: z.string().min(1).describe("뒤집을 문자열"), }, async ({ text }) => { const result = reverseString(text); return { content: [ { type: "text", text: `원본: ${result.original}\n뒤집음: ${result.reversed}`, }, ], }; } );
- src/index.ts:222-223 (schema)Zod schema for input validation: requires a non-empty string 'text'.text: z.string().min(1).describe("뒤집을 문자열"), },
- src/tools.ts:170-170 (registration)Lists 'reverse_string' in the server info tools array."reverse_string - 문자열 뒤집기",