Skip to main content
Glama
BaseService.ts924 B
import { ITransport } from '../../transports/index.js'; /** * Base service class providing transport abstraction * All Unity services should extend this class */ export class BaseService { protected transport: ITransport; constructor(transport: ITransport) { this.transport = transport; } /** * Check if Unity Editor is reachable */ async health(): Promise<boolean> { try { return await this.transport.isConnected(); } catch { return false; } } /** * Send a request to Unity Editor via the configured transport * @param endpoint The endpoint path * @param data The request data * @returns The response from Unity */ protected async post<T = any>(endpoint: string, data: any): Promise<T> { try { return await this.transport.request<T>(endpoint, data); } catch (error) { throw error; } } }

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/muammar-yacoob/unity-mcp'

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