import { approvalsTool, approvalsHandler } from './approvals.js';
import { toMCPResponse } from '../types.js';
export function registerTools() {
    return [approvalsTool];
}
export async function handleToolCall(name, args, context) {
    let response;
    let isError = false;
    try {
        switch (name) {
            case 'approvals':
                response = await approvalsHandler(args, context);
                break;
            default:
                throw new Error(`Unknown tool: ${name}`);
        }
        isError = !response.success;
    }
    catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        response = {
            success: false,
            message: `Tool execution failed: ${errorMessage}`
        };
        isError = true;
    }
    return toMCPResponse(response, isError);
}
//# sourceMappingURL=index.js.map