Skip to main content
Glama
interface-support.md597 B
## Interface Support Deserialize also works with interfaces. For interfaces, a namespace is generated with `is` (type guard) and `fromJSON` functions: <MacroExample before={data.examples.interface.before} after={data.examples.interface.after} /> ```typescript const json = { status: 200, message: "OK", timestamp: "2024-01-15T10:30:00.000Z" }; // Type guard if (ApiResponse.is(json)) { console.log(json.status); // TypeScript knows this is ApiResponse } // Deserialize with validation const response = ApiResponse.fromJSON(json); console.log(response.timestamp instanceof Date); // true ```

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/macroforge-ts/mcp-server'

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