boscli_system_logs
Retrieve recent BOS ERP log entries filtered by severity level and line count for system monitoring and troubleshooting.
Instructions
Read recent BOS log entries
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | ||
| level | No |
Implementation Reference
- src/tools/system.ts:12-18 (handler)The handler for 'boscli_system_logs' tool. It calls client.get('/boscli/system/logs', args) to fetch recent BOS log entries from the API, passing optional query parameters (lines, level).
name: 'boscli_system_logs', description: 'Read recent BOS log entries', schema: { lines: { type: 'number', optional: true }, level: { type: 'string', enum: ['error', 'warning', 'info'], optional: true }, }, handler: async (args, client) => client.get('/boscli/system/logs', args), - src/tools/system.ts:14-17 (schema)Input schema for 'boscli_system_logs': optional 'lines' (number) and optional 'level' (enum: error, warning, info). Validated via toZodSchema() at registration time.
schema: { lines: { type: 'number', optional: true }, level: { type: 'string', enum: ['error', 'warning', 'info'], optional: true }, }, - src/index.ts:54-76 (registration)Registration in src/index.ts: all tools (including boscli_system_logs via systemTools spread) are iterated and registered via server.tool() with Zod schema conversion and error-handled handler wrapper.
// 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/stdio.ts:54-74 (registration)Registration in src/stdio.ts (STDIO transport): same pattern as index.ts — systemTools spread into allTools, then each tool registered 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, }; } } ); } - src/http.ts:55-75 (registration)Registration in src/http.ts (HTTP/SSE transport): same pattern — systemTools spread into allTools, each tool registered 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, }; } } ); }