boscli_health_modules
Check the health status of all BOS modules to identify issues and maintain system stability.
Instructions
Check health of all BOS modules
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/health.ts:11-15 (handler)Handler function that executes the 'boscli_health_modules' tool logic - calls GET /boscli/health/modules via the BosApiClient.
{ name: 'boscli_health_modules', description: 'Check health of all BOS modules', schema: {}, handler: async (_, client) => client.get('/boscli/health/modules'), - src/tools/health.ts:14-14 (schema)The schema is an empty object {}, meaning this tool takes no parameters.
schema: {}, - src/index.ts:54-76 (registration)The tool is registered via the 'healthTools' array, which is imported from tools/health.ts. In src/index.ts, all tools are iterated and registered via server.tool() with a Zod schema conversion.
// Register all tools with proper Zod schemas 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, }; } } ); } - src/tools/index.ts:21-62 (helper)The toZodSchema helper converts the tool's schema (empty {}) into a Zod object for MCP SDK registration.
export function toZodSchema(schema: Record<string, any>): z.ZodObject<any> { const shape: Record<string, z.ZodTypeAny> = {}; for (const [key, def] of Object.entries(schema)) { let field: z.ZodTypeAny; switch (def.type) { case 'number': field = z.number(); break; case 'boolean': field = z.boolean(); break; case 'array': field = z.array(z.any()); break; case 'object': field = z.record(z.any()); break; case 'string': default: if (def.enum) { field = z.enum(def.enum); } else { field = z.string(); } break; } if (def.description) { field = field.describe(def.description); } if (def.optional) { field = field.optional(); } shape[key] = field; } return z.object(shape); }