Skip to main content
Glama
observability.ts1.89 kB
import { LiaraClient } from '../api/client.js'; import { MetricsSummary, LogEntry, } from '../api/types.js'; import { validateAppName } from '../utils/errors.js'; /** * Get app metrics summary */ export async function getAppMetrics( client: LiaraClient, appName: string, period?: string ): Promise<MetricsSummary> { validateAppName(appName); const params: Record<string, string | number | boolean> | undefined = period ? { period } : undefined; return await client.get<MetricsSummary>( `/v1/projects/${appName}/metrics/summary`, params ); } /** * Get app logs * @param limit - Maximum number of log entries to return (default: 100) * @param since - ISO timestamp to fetch logs since * @param until - ISO timestamp to fetch logs until */ export async function getAppLogs( client: LiaraClient, appName: string, options?: { limit?: number; since?: string; until?: string; } ): Promise<LogEntry[]> { validateAppName(appName); const params: any = {}; if (options?.limit) { params.limit = options.limit; } if (options?.since) { params.since = options.since; } if (options?.until) { params.until = options.until; } return await client.get<LogEntry[]>( `/v1/projects/${appName}/logs`, params ); } /** * Stream app logs (real-time) * Note: This would typically use WebSocket, but for MCP we return recent logs * For true streaming, consider implementing WebSocket support separately */ export async function streamAppLogs( client: LiaraClient, appName: string ): Promise<LogEntry[]> { validateAppName(appName); // For now, return recent logs // WebSocket streaming would require separate implementation return await getAppLogs(client, appName, { limit: 100 }); }

Implementation Reference

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/razavioo/liara-mcp'

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