UNPKG

@brianveltman/sonatype-mcp

Version:

Model Context Protocol server for Sonatype Nexus Repository Manager

38 lines 1.24 kB
import { formatMCPError } from '../../utils/errors.js'; export function createGetMetricsTool(adminService) { return { name: 'nexus_get_metrics', description: 'Retrieve system metrics including memory, threads, and file descriptors', inputSchema: { type: 'object', properties: {}, additionalProperties: false }, handler: async (_params) => { try { const metrics = await adminService.getMetrics(); return { content: [ { type: 'text', text: JSON.stringify(metrics, null, 2) } ] }; } catch (error) { const mcpError = formatMCPError(error); return { content: [ { type: 'text', text: `Error getting metrics: ${mcpError.message}` } ], isError: true }; } } }; } //# sourceMappingURL=get-metrics.js.map