@edicarlos.lds/businessmap-mcp
Version:
Model Context Protocol server for BusinessMap (Kanbanize) integration
48 lines • 1.87 kB
JavaScript
import { getApiInfoSchema, healthCheckSchema } from '../../schemas/utility-schemas.js';
import { createErrorResponse, createSuccessResponse } from './base-tool.js';
export class UtilityToolHandler {
registerTools(server, client, readOnlyMode) {
this.registerHealthCheck(server, client);
this.registerGetApiInfo(server, client);
}
registerHealthCheck(server, client) {
server.registerTool('health_check', {
title: 'Health Check',
description: 'Check the connection to BusinessMap API',
inputSchema: healthCheckSchema.shape,
annotations: { readOnlyHint: true, idempotentHint: true },
}, async () => {
try {
const isHealthy = await client.healthCheck();
return {
content: [
{
type: 'text',
text: `BusinessMap API Health: ${isHealthy ? 'Healthy' : 'Unhealthy'}`,
},
],
};
}
catch (error) {
return createErrorResponse(error, 'health check failed');
}
});
}
registerGetApiInfo(server, client) {
server.registerTool('get_api_info', {
title: 'Get API Info',
description: 'Get information about the BusinessMap API',
inputSchema: getApiInfoSchema.shape,
annotations: { readOnlyHint: true, idempotentHint: true },
}, async () => {
try {
const apiInfo = await client.getApiInfo();
return createSuccessResponse(apiInfo);
}
catch (error) {
return createErrorResponse(error, 'fetching API info');
}
});
}
}
//# sourceMappingURL=utility-tools.js.map