Skip to main content
Glama

llmkit_health

Read-onlyIdempotent

Check proxy health and response time to monitor connectivity and performance for AI service queries.

Instructions

Check proxy health and response time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
responseTimeMsNo

Implementation Reference

  • The `handleHealth` function implements the logic for `llmkit_health` by performing a network request to the proxy's `/health` endpoint and calculating the response time.
    export async function handleHealth() {
      const config = loadConfig();
      if (!config) {
        return fail(`LLMKIT_API_KEY required. The llmkit_local_* tools work without a key.\nGet one at ${DASHBOARD_URL}`);
      }
      const start = Date.now();
      try {
        const res = await fetch(`${config.proxyUrl}/health`, { signal: AbortSignal.timeout(5000) });
        const elapsed = Date.now() - start;
        const status = res.status === 200 ? 'ok' : 'degraded';
        return ok(`Proxy: ${status.toUpperCase()} (${elapsed}ms)`, { status, responseTimeMs: elapsed });
      } catch (err) {
        const elapsed = Date.now() - start;
        return ok(`Proxy: UNREACHABLE (${elapsed}ms)\n${err instanceof Error ? err.message : err}`, { status: 'unreachable', responseTimeMs: elapsed });
      }
    }
  • The definition and schema for the `llmkit_health` tool.
      name: 'llmkit_health',
      description: 'Check proxy health and response time',
      inputSchema: { type: 'object' as const, properties: {} },
      outputSchema: {
        type: 'object' as const,
        properties: {
          status: { type: 'string', enum: ['ok', 'degraded', 'unreachable'] },
          responseTimeMs: { type: 'number' },
        },
        required: ['status'],
      },
      annotations: { title: 'Health Check', ...HINTS },
    },
  • Registration of `llmkit_health` in the `HANDLER_MAP` in `tools.ts`.
    llmkit_health: () => handleHealth(),

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/smigolsmigol/llmkit-mcp-server'

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