Skip to main content
Glama

MCP Gemini Server

by bsmi021
exampleToolParams.ts1.11 kB
import { z } from "zod"; export const TOOL_NAME = "exampleTool"; export const TOOL_DESCRIPTION = "An example tool that takes a name and returns a greeting message. Demonstrates the basic structure of an MCP tool using Zod for parameter definition."; // Define parameters using Zod for validation and description generation // We need to define this as a raw object with Zod validators (not wrapped in z.object) // to be compatible with the MCP server.tool() method export const TOOL_PARAMS = { name: z .string() .min(1, { message: "Name cannot be empty." }) .max(50, { message: "Name cannot exceed 50 characters." }) .describe( "The name to include in the greeting message. Required, 1-50 characters." ), // Example optional parameter language: z .enum(["en", "es", "fr"]) .optional() .describe( "Optional language code for the greeting (e.g., 'en', 'es', 'fr'). Defaults to 'en' if not provided or invalid." ), }; // For internal validation within the tool, we can create a complete schema export const exampleToolSchema = z.object(TOOL_PARAMS);

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/bsmi021/mcp-gemini-server'

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