Skip to main content
Glama
git-fabric

@git-fabric/chat

Official
by git-fabric

chat_health

Check service connectivity and latency for AI conversation components to verify operational status before sending messages.

Instructions

Ping Anthropic and Qdrant services. Returns latency for each. Use to verify the app is operational before sending messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/app.ts:320-340 (registration)
    Registration of the chat_health tool with name, description, empty inputSchema, and execute function that calls adapter.health() and adds totalLatencyMs and status calculation.
    {
      name: "chat_health",
      description:
        "Ping Anthropic and Qdrant services. Returns latency for each. Use to verify the app is operational before sending messages.",
      inputSchema: {
        type: "object",
        properties: {},
      },
      execute: async () => {
        const start = Date.now();
        const h = await adapter.health();
        return {
          ...h,
          totalLatencyMs: Date.now() - start,
          status:
            h.anthropic.latencyMs < 10000 && h.qdrant.latencyMs < 10000
              ? "healthy"
              : "degraded",
        };
      },
    },
  • Implementation of the health() method that pings Anthropic API and Qdrant healthz endpoint, measuring and returning latency for each service in the ChatHealth format.
    async health() {
      // Anthropic ping
      const anthropicStart = Date.now();
      try {
        await anthropic.messages.create({
          model: "claude-haiku-4-5-20251001",
          max_tokens: 1,
          messages: [{ role: "user", content: "ping" }],
        });
      } catch {
        // Ignore — we measure latency regardless
      }
      const anthropicLatency = Date.now() - anthropicStart;
    
      // Qdrant ping
      const qdrantStart = Date.now();
      try {
        await fetch(`${qdrantUrl}/healthz`, {
          headers: { "api-key": qdrantKey },
        });
      } catch {
        // Ignore — we measure latency regardless
      }
      const qdrantLatency = Date.now() - qdrantStart;
    
      return {
        anthropic: { latencyMs: anthropicLatency },
        qdrant: { latencyMs: qdrantLatency },
      };
    },
  • ChatHealth interface definition specifying the return type with anthropic and qdrant latencyMs fields.
    export interface ChatHealth {
      anthropic: { latencyMs: number };
      qdrant: { latencyMs: number };
    }
  • health() method signature in the ChatAdapter interface, returning Promise<ChatHealth>.
    health(): Promise<ChatHealth>;
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by disclosing key behaviors: it performs ping operations (implying read-only, non-destructive checks), returns latency metrics, and serves as a pre-message verification step. It doesn't detail error handling or rate limits, but covers the core functionality adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste: the first states the action and output, the second provides usage context. It's front-loaded with the core purpose and efficiently structured, earning its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is complete enough for its diagnostic purpose. It explains what it does, when to use it, and the return value (latency for each service), though it could note the format of the latency data (e.g., in milliseconds) for slightly better completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the inputs. The description adds no parameter-specific information, which is fine since there are none. A baseline of 4 is appropriate as it doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Ping Anthropic and Qdrant services') and the resource ('services'), with a distinct purpose of verifying operational status before sending messages. This differentiates it from sibling tools focused on chat operations like message sending or session management.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use this tool ('to verify the app is operational before sending messages'), providing clear context for its application. It implies an alternative (not using it could risk sending messages when services are down), though it doesn't name specific sibling alternatives, which is acceptable given its unique diagnostic role.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/chat'

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