Skip to main content
Glama

aiana_health

Check connection status and latency for the semantic memory layer, ensuring reliable access to stored and managed persistent memories with privacy protection.

Instructions

Ping Qdrant Cloud and return connection status and latency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of the health() method that pings Qdrant Cloud. Measures latency, tries /healthz endpoint first, falls back to collection check, and returns status ('healthy' or 'unavailable') with latencyMs.
    async health(): Promise<{
      status: "healthy" | "degraded" | "unavailable";
      latencyMs: number;
    }> {
      const start = Date.now();
      try {
        await qdrantRequest(qdrantUrl, qdrantApiKey, "GET", "/healthz");
        return { status: "healthy", latencyMs: Date.now() - start };
      } catch {
        // /healthz may not exist on all versions — try collections endpoint
        try {
          await qdrantRequest(qdrantUrl, qdrantApiKey, "GET", `/collections/${COLLECTION}`);
          return { status: "healthy", latencyMs: Date.now() - start };
        } catch {
          return { status: "unavailable", latencyMs: Date.now() - start };
        }
      }
    },
  • src/app.ts:249-257 (registration)
    Registration of the aiana_health tool in the tools array. Defines name, description, input schema (empty object), and execute function that delegates to adapter.health().
    {
      name: "aiana_health",
      description: "Ping Qdrant Cloud and return connection status and latency.",
      inputSchema: {
        type: "object",
        properties: {},
      },
      execute: async (_args) => adapter.health(),
    },
  • Type definition for the health() method return type in the AianaAdapter interface, specifying status as 'healthy' | 'degraded' | 'unavailable' and latencyMs as number.
    health(): Promise<{
      status: "healthy" | "degraded" | "unavailable";
      latencyMs: number;
    }>;
  • The qdrantRequest helper function used by health() to make HTTP requests to Qdrant. Handles authentication, error checking, and response parsing.
    async function qdrantRequest<T>(
      baseUrl: string,
      apiKey: string,
      method: string,
      path: string,
      body?: unknown,
    ): Promise<T> {
      const url = `${baseUrl}${path}`;
      const res = await fetch(url, {
        method,
        headers: makeQdrantHeaders(apiKey),
        body: body !== undefined ? JSON.stringify(body) : undefined,
      });
      if (!res.ok) {
        const text = await res.text().catch(() => "(no body)");
        throw new Error(`Qdrant ${method} ${path} → HTTP ${res.status}: ${text}`);
      }
      // DELETE 200 may return empty body
      const text = await res.text();
      if (!text) return {} as T;
      return JSON.parse(text) as T;
    }

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/git-fabric/aiana'

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