Skip to main content
Glama
bizino

BOS MCP Server

by bizino

boscli_health_check

Run a comprehensive health check on your BOS ERP system, verifying modules, database, cache, and routes to ensure all components are operational.

Instructions

Full BOS system health check - modules, database, cache, routes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for boscli_health_check - makes a GET request to '/boscli/health' using the BosApiClient.
    handler: async (_, client) => client.get('/boscli/health'),
  • Empty schema for boscli_health_check - no input parameters required.
    schema: {},
  • Tool definition as part of the healthTools array. Exported and spread into allTools in src/index.ts, src/stdio.ts, and src/http.ts.
    export const healthTools: McpTool[] = [
      {
        name: 'boscli_health_check',
        description: 'Full BOS system health check - modules, database, cache, routes',
        schema: {},
        handler: async (_, client) => client.get('/boscli/health'),
      },
      {
        name: 'boscli_health_modules',
        description: 'Check health of all BOS modules',
        schema: {},
        handler: async (_, client) => client.get('/boscli/health/modules'),
      },
      {
        name: 'boscli_health_database',
        description: 'Check BOS database connectivity',
        schema: {},
        handler: async (_, client) => client.get('/boscli/health/database'),
      },
      {
        name: 'boscli_health_cache',
        description: 'Check BOS cache systems',
        schema: {},
        handler: async (_, client) => client.get('/boscli/health/cache'),
      },
      {
        name: 'boscli_health_schema',
        description: 'Check BOS database schema integrity',
        schema: {},
        handler: async (_, client) => client.get('/boscli/health/schema'),
      },
    ];
  • src/index.ts:55-76 (registration)
    Registration loop in the main server - iterates allTools (including healthTools) and registers each with the McpServer via server.tool().
    for (const tool of allTools) {
      const zodSchema = toZodSchema(tool.schema);
    
      server.tool(
        tool.name,
        tool.description,
        zodSchema.shape,
        async (args: any) => {
          try {
            const result = await tool.handler(args, client);
            return {
              content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (error: any) {
            return {
              content: [{ type: 'text' as const, text: JSON.stringify({ error: error.message || 'Unknown error' }) }],
              isError: true,
            };
          }
        }
      );
    }
  • BosApiClient class - the helper that executes the actual HTTP GET request to '/boscli/health'. Uses axios with retry logic and rate limiting.
    export class BosApiClient {
      private client: AxiosInstance;
    
      constructor(config?: Partial<BosMcpConfig>) {
        const cfg = mergeConfig(config);
        this.client = axios.create({
          baseURL: cfg.bosApiUrl,
          timeout: cfg.timeout,
          headers: {
            'Content-Type': 'application/json',
            // BUG 5 FIX: Send x-mcp-api-key header that Laravel McpAuth middleware expects
            ...(cfg.mcpApiKey && { 'x-mcp-api-key': cfg.mcpApiKey }),
            ...(cfg.bosApiToken && { 'Authorization': `Bearer ${cfg.bosApiToken}` }),
          },
        });
      }
    
      async request<T>(method: string, path: string, data?: any, params?: Record<string, any>): Promise<T> {
        while (!(await rateLimiter.acquire())) {
          await new Promise(resolve => setTimeout(resolve, 1000));
        }
    
        let lastError: Error | null = null;
        for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
          try {
            const response = await this.client.request<T>({
              method,
              url: path,
              ...(data && { data }),
              // BUG 2 FIX: Support query params for GET requests
              ...(params && { params }),
            });
            return response.data;
          } catch (error) {
            if (error instanceof AxiosError) {
              const status = error.response?.status;
              if (status && status >= 400 && status < 500 && status !== 429) {
                throw error;
              }
              lastError = error;
              if (attempt < MAX_RETRIES - 1) {
                await new Promise(resolve => setTimeout(resolve, RETRY_DELAY * (attempt + 1)));
              }
            } else {
              throw error;
            }
          }
        }
        throw lastError || new Error('Request failed after retries');
      }
    
      // BUG 2+3 FIX: GET now accepts optional query params
      async get<T>(path: string, params?: Record<string, any>): Promise<T> {
        return this.request<T>('GET', path, undefined, params);
      }
    
      async post<T>(path: string, data?: any): Promise<T> {
        return this.request<T>('POST', path, data);
      }
    
      async put<T>(path: string, data?: any): Promise<T> {
        return this.request<T>('PUT', path, data);
      }
    
      async delete<T>(path: string): Promise<T> {
        return this.request<T>('DELETE', path);
      }
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It lists the checked components but does not mention whether the tool is read-only, safe, requires authentication, or has any side effects. This is a significant gap for a system-level operation.

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 concise sentence that conveys the tool's purpose without any unnecessary words. It is well-structured and front-loaded.

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 simplicity (no parameters, no annotations, no output schema), the description is adequate but lacking: it does not explain what the tool returns (e.g., status, metrics, errors) or provide any behavioral depth. It is minimally viable.

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 zero parameters, so the description does not need to add parameter information. Baseline score of 4 is appropriate as the description does not contradict or omit anything relevant to parameters.

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 tool performs a full system health check covering modules, database, cache, and routes. It is specific and distinct from sibling tools like boscli_health_database or boscli_health_cache, which check individual components.

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

Usage Guidelines3/5

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

The description implies this tool is a comprehensive health check compared to individual health tools, but it does not explicitly state when to use this over alternatives or provide any usage context or exclusions.

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/bizino/bos-mcp'

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