Skip to main content
Glama

example_operation

Process user data by validating and structuring inputs such as name, email, and date for integration with AI models in the MCP Server TypeScript Template.

Instructions

A simple example operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
emailYes
nameYes

Implementation Reference

  • Core execution logic for the example_operation tool: builds a URL and sends an API request.
    export async function exampleApiCall(params: z.infer<typeof ExampleSchema>) { return sendRequest(buildUrl("https://example.com/search", params)); }
  • index.ts:55-61 (handler)
    MCP CallToolRequest handler dispatching for example_operation: validates input with schema and invokes the core handler.
    case "example_operation": { const args = ExampleSchema.parse(request.params.arguments); const result = await operation.exampleApiCall(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
  • Zod schema defining the input parameters for the example_operation tool (name, email, date).
    export const ExampleSchema = z.object({ name: z.string(), email: z.string(), date: z.string(), });
  • index.ts:34-38 (registration)
    Tool metadata registration in ListToolsResponse: name, description, and derived JSON input schema.
    { name: "example_operation", description: "A simple example operation", inputSchema: zodToJsonSchema(ExampleSchema), },
  • index.ts:11-11 (registration)
    Import of the operation module containing the tool handler.
    import * as operation from './operations/example-operation';

Other Tools

Related 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/minimind-org/mcp-server-typescript-template'

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