
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e5b70a4f-76da-59b0-aefa-e52b37ee065f")}catch(e){}}();
import { mcpClients } from 'mcp-client-capabilities';
/**
 * Determines if the MCP client supports dynamic tools based on the InitializeRequest data.
 */
export function doesMcpClientSupportDynamicTools(initializeRequestData) {
    var _a, _b, _c, _d;
    const clientName = (_b = (_a = initializeRequestData === null || initializeRequestData === void 0 ? void 0 : initializeRequestData.params) === null || _a === void 0 ? void 0 : _a.clientInfo) === null || _b === void 0 ? void 0 : _b.name;
    const clientCapabilities = mcpClients[clientName || ''];
    if (!clientCapabilities)
        return false;
    const clientProtocolVersion = clientCapabilities.protocolVersion;
    const knownProtocolVersion = (_c = initializeRequestData === null || initializeRequestData === void 0 ? void 0 : initializeRequestData.params) === null || _c === void 0 ? void 0 : _c.protocolVersion;
    // Compare the protocolVersion to check if the client is up to date
    // We check for strict equality because if the versions differ, we cannot be sure about the capabilities
    if (clientProtocolVersion !== knownProtocolVersion) {
        // Client version is different from the known version, we cannot be sure about its capabilities
        return false;
    }
    return ((_d = clientCapabilities.tools) === null || _d === void 0 ? void 0 : _d.listChanged) === true;
}
//# sourceMappingURL=mcp_clients.js.map
//# debugId=e5b70a4f-76da-59b0-aefa-e52b37ee065f
