Skip to main content
Glama

Check LibreModel Server Health

health_check

Verify the operational status of the local llama-server to ensure it is running and responsive for use with Claude Desktop.

Instructions

Check if the llama-server is running and responsive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function for the 'health_check' tool. It performs a health check by fetching the /health endpoint with a 5-second timeout, optionally fetches /props for server info, and returns formatted status or error content.
    }, async () => {
      try {
        // Create abort controller for timeout
        const abortController = new AbortController();
        const timeoutId = setTimeout(() => abortController.abort(), 5000);
    
        const healthResponse = await fetch(`${this.config.url}/health`, {
          method: "GET",
          signal: abortController.signal
        });
        
        clearTimeout(timeoutId);
    
        const isHealthy = healthResponse.ok;
        const status = healthResponse.status;
    
        // Try to get server props if available
        let serverInfo = "No additional info available";
        try {
          const propsResponse = await fetch(`${this.config.url}/props`);
          if (propsResponse.ok) {
            const props = await propsResponse.json();
            serverInfo = JSON.stringify(props, null, 2);
          }
        } catch (e) {
          // Props endpoint might not exist, that's OK
        }
    
        return {
          content: [
            {
              type: "text",
              text: `**LibreModel Server Health Check:**\n\n**Status:** ${isHealthy ? "✅ Healthy" : "❌ Unhealthy"}\n**HTTP Status:** ${status}\n**Server URL:** ${this.config.url}\n\n**Server Information:**\n\`\`\`json\n${serverInfo}\n\`\`\``
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error && error.name === 'AbortError' 
          ? 'Request timed out after 5 seconds'
          : error instanceof Error ? error.message : String(error);
          
        return {
          content: [
            {
              type: "text",
              text: `**Health check failed:**\n❌ Cannot reach LibreModel server at ${this.config.url}\n\n**Error:** ${errorMessage}\n\n**Troubleshooting:**\n- Is llama-server running?\n- Is it listening on ${this.config.url}?\n- Check firewall/network settings`
            }
          ],
          isError: true
        };
      }
  • The schema definition for the 'health_check' tool, including title, description, and empty inputSchema (no parameters required).
    title: "Check LibreModel Server Health",
    description: "Check if the llama-server is running and responsive",
    inputSchema: {}
  • src/index.ts:159-215 (registration)
    The registration of the 'health_check' tool in the setupTools method using this.server.registerTool, including the schema object and handler function.
    // Server health check
    this.server.registerTool("health_check", {
      title: "Check LibreModel Server Health",
      description: "Check if the llama-server is running and responsive",
      inputSchema: {}
    }, async () => {
      try {
        // Create abort controller for timeout
        const abortController = new AbortController();
        const timeoutId = setTimeout(() => abortController.abort(), 5000);
    
        const healthResponse = await fetch(`${this.config.url}/health`, {
          method: "GET",
          signal: abortController.signal
        });
        
        clearTimeout(timeoutId);
    
        const isHealthy = healthResponse.ok;
        const status = healthResponse.status;
    
        // Try to get server props if available
        let serverInfo = "No additional info available";
        try {
          const propsResponse = await fetch(`${this.config.url}/props`);
          if (propsResponse.ok) {
            const props = await propsResponse.json();
            serverInfo = JSON.stringify(props, null, 2);
          }
        } catch (e) {
          // Props endpoint might not exist, that's OK
        }
    
        return {
          content: [
            {
              type: "text",
              text: `**LibreModel Server Health Check:**\n\n**Status:** ${isHealthy ? "✅ Healthy" : "❌ Unhealthy"}\n**HTTP Status:** ${status}\n**Server URL:** ${this.config.url}\n\n**Server Information:**\n\`\`\`json\n${serverInfo}\n\`\`\``
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error && error.name === 'AbortError' 
          ? 'Request timed out after 5 seconds'
          : error instanceof Error ? error.message : String(error);
          
        return {
          content: [
            {
              type: "text",
              text: `**Health check failed:**\n❌ Cannot reach LibreModel server at ${this.config.url}\n\n**Error:** ${errorMessage}\n\n**Troubleshooting:**\n- Is llama-server running?\n- Is it listening on ${this.config.url}?\n- Check firewall/network settings`
            }
          ],
          isError: true
        };
      }
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool checks if the server is 'running and responsive,' which implies a read-only, non-destructive operation, but it doesn't specify details like response format, error handling, timeouts, or what 'responsive' entails. This leaves gaps in understanding the tool's behavior.

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?

The description is a single, clear sentence: 'Check if the llama-server is running and responsive.' It's front-loaded with the core purpose, has no unnecessary words, and efficiently conveys the essential information without waste.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains the basic purpose but lacks details on behavioral aspects like what the check entails or output expectations. For a health check tool, more context on response behavior would improve completeness, but it meets the minimum viable threshold.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied since the schema fully covers the lack of parameters, and the description doesn't introduce confusion.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Check if the llama-server is running and responsive.' It specifies the verb ('Check') and resource ('llama-server'), making it understandable. However, it doesn't explicitly distinguish this from sibling tools like 'chat' or 'quick_test', which might also involve server interaction, so it falls short of a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like pre-operation verification, troubleshooting, or how it differs from siblings such as 'chat' or 'quick_test'. Without this context, users must infer usage based on the tool name alone.

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/openconstruct/llama-mcp-server'

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