Skip to main content
Glama
CaptainCrouton89

MCP Server Boilerplate

hello-world

Generate personalized greetings by providing a user name, demonstrating basic tool functionality in MCP server development.

Instructions

Say hello to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the user

Implementation Reference

  • The asynchronous handler function for the 'hello-world' tool that receives a 'name' parameter and returns a text content block with a greeting message.
    async ({ name }) => {
      const response = `Hello ${name}`;
    
      return {
        content: [
          {
            type: "text",
            text: response,
          },
        ],
      };
    }
  • The input schema for the 'hello-world' tool, defining a required 'name' string parameter.
    {
      name: z.string().describe("The name of the user"),
    },
  • src/index.ts:14-31 (registration)
    The registration of the 'hello-world' tool on the MCP server using server.tool(), specifying the tool name, description, input schema, and handler function.
      "hello-world",
      "Say hello to the user",
      {
        name: z.string().describe("The name of the user"),
      },
      async ({ name }) => {
        const response = `Hello ${name}`;
    
        return {
          content: [
            {
              type: "text",
              text: response,
            },
          ],
        };
      }
    );
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/CaptainCrouton89/mcp-reasoning'

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