Skip to main content
Glama
wubbyweb

MCP Demo Project

by wubbyweb

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
NameRequiredDescriptionDefault
wordYesThe word to reverse

Implementation Reference

  • 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("");
    }
  • 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,
  • 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("");
    }
  • 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"),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the transformation action ('reverses'), but does not mention any behavioral traits such as error handling for non-string inputs, performance characteristics, or what happens with empty strings. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It is appropriately sized and front-loaded, making it easy to understand immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is minimally adequate. However, it lacks details on return values or error behavior, which would be helpful for a mutation tool. It meets basic needs but has clear gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'word' fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples or edge cases. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('reverses the characters') and the target resource ('in a given word'), with no siblings to differentiate from. It uses precise language that directly explains the tool's function without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'given word', but provides no explicit guidance on when to use this tool versus alternatives or any contextual constraints. With no sibling tools, the lack of comparative guidance is less critical, but it still offers only basic implied context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/wubbyweb/mcp-demo'

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