sonatype-mcp
Version:
Model Context Protocol server for Sonatype Nexus Repository Manager
43 lines (42 loc) • 1.36 kB
JavaScript
import { validateInput, getSystemStatusSchema } from '../../utils/validation.js';
import { formatMCPError } from '../../utils/errors.js';
/**
* Get system status tool
*/
export function createGetSystemStatusTool(adminService) {
return {
name: 'nexus_get_system_status',
description: 'Get system health status and checks',
inputSchema: {
type: 'object',
properties: {},
additionalProperties: false
},
handler: async (params) => {
try {
validateInput(getSystemStatusSchema, params);
const status = await adminService.getSystemStatus();
return {
content: [
{
type: 'text',
text: JSON.stringify(status, null, 2)
}
]
};
}
catch (error) {
const mcpError = formatMCPError(error);
return {
content: [
{
type: 'text',
text: `Error getting system status: ${mcpError.message}`
}
],
isError: true
};
}
}
};
}