Skip to main content
Glama
by microsoft
greeter.ts.slides.md936 B
### Introduction - TypeScript class example - Demonstrates basic class structure - Shows instantiation and method usage --- ### Class Definition - `Greeter` class with a single property - Constructor to initialize the property - Method to return a greeting message ```ts class Greeter { greeting: string; ... } ``` --- ### Constructor - Initializes the `greeting` property - Takes a `message` parameter ```ts constructor(message: string) { this.greeting = message; } ``` --- ### Greet Method - Constructs a greeting string - Returns the greeting with "Hello, " ```ts greet() { return "Hello, " + this.greeting; } ``` --- ### Instantiation - Creating an instance of `Greeter` - Passing "world" as the greeting message ```ts let greeter = new Greeter("world"); ``` --- ### Summary - Explored a TypeScript `Greeter` class - Covered class structure and methods - Demonstrated object creation and interaction

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/microsoft/genaiscript'

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