Skip to main content
Glama
stevennevins

MCP Server Template

by stevennevins

example-tool

Processes input data to transform or analyze strings for integration within MCP server workflows. This tool handles text processing tasks within the TypeScript-based MCP Server Template framework.

Instructions

An example tool that processes input data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesInput string to process

Implementation Reference

  • Handler implementation for 'example-tool' that extracts input, validates with Zod, processes via helper function, and returns the tool result.
    'example-tool': async (request) => {
      try {
        const { input } = request.params.arguments as { input: string }
        const inputSchema = z.object({
          input: z.string().min(1, 'Input must not be empty')
        })
        inputSchema.parse({ input })
        const result = await handleExampleProcess(input)
    
        return {
          toolResult: {
            content: [{ type: 'text', text: result }],
          },
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error)
        throw new Error(`Failed to process input: ${errorMessage}`)
      }
    }
  • Tool schema definition for 'example-tool' including name, description, and input schema.
    const EXAMPLE_TOOL: Tool = {
      name: 'example-tool',
      description: 'An example tool that processes input data',
      inputSchema: {
        type: 'object',
        properties: {
          input: {
            type: 'string',
            description: 'Input string to process',
            minLength: 1
          }
        },
        required: ['input']
      }
    }
  • src/index.ts:21-22 (registration)
    Combines example tools and handlers into global collections used by the MCP server for tool listing and execution.
    const ALL_TOOLS = [...EXAMPLE_TOOLS]
    const ALL_HANDLERS = { ...EXAMPLE_HANDLERS }
  • src/index.ts:31-34 (registration)
    Registers the request handler for listing available tools, which includes 'example-tool' via ALL_TOOLS.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      log('Received list tools request')
      return { tools: ALL_TOOLS }
    })
  • Helper function called by the tool handler to process the input string.
    async function handleExampleProcess(input: string): Promise<string> {
      log('Processing input:', input)
      return `Processed: ${input}`
    }
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 tool 'processes input data', which implies some action but doesn't reveal behavioral traits like whether it's read-only, destructive, requires authentication, has side effects, or rate limits. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it's front-loaded with the basic purpose but lacks structure or additional details that could enhance clarity, keeping it simple but under-specified.

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

Completeness2/5

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

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It doesn't explain what 'processes' means, the expected output, or behavioral context, leaving the agent with insufficient information to use the tool effectively despite the straightforward schema.

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?

The description adds no specific meaning about the 'input' parameter beyond what the schema provides, which has 100% coverage and describes it as 'Input string to process'. With high schema coverage, the baseline is 3, as the schema adequately documents the parameter, and the description doesn't compensate or add further semantics.

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

Purpose3/5

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

The description states the tool 'processes input data', which provides a basic purpose but is vague about what 'processes' entails. It doesn't specify the type of processing or outcome, and with no sibling tools, differentiation isn't needed. This is a minimal viable description that communicates a general function without specifics.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool, such as context, prerequisites, or alternatives. With no sibling tools, it doesn't need to distinguish from others, but it lacks any usage instructions or scenarios, leaving the agent without direction on appropriate application.

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/stevennevins/mcp-server-template'

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