Skip to main content
Glama
dh1789

My First MCP

by dh1789

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
NameRequiredDescriptionDefault
textYes뒤집을 문자열

Implementation Reference

  • 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, }; }
  • 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}`, }, ], }; } );
  • 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 - 문자열 뒤집기",

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/dh1789/my-first-mcp'

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