diff --git a/apps/sim/app/api/mcp/tools/execute/route.ts b/apps/sim/app/api/mcp/tools/execute/route.ts index 8371b88c2..4229cebbf 100644 --- a/apps/sim/app/api/mcp/tools/execute/route.ts +++ b/apps/sim/app/api/mcp/tools/execute/route.ts @@ -2,6 +2,7 @@ import { createLogger } from '@sim/logger' import type { NextRequest } from 'next/server' import { getHighestPrioritySubscription } from '@/lib/billing/core/plan' import { getExecutionTimeout } from '@/lib/core/execution-limits' +import type { SubscriptionPlan } from '@/lib/core/rate-limiter/types' import { getParsedBody, withMcpAuth } from '@/lib/mcp/middleware' import { mcpService } from '@/lib/mcp/service' import type { McpTool, McpToolCall, McpToolResult } from '@/lib/mcp/types' @@ -173,7 +174,10 @@ export const POST = withMcpAuth('read')( } const userSubscription = await getHighestPrioritySubscription(userId) - const executionTimeout = getExecutionTimeout(userSubscription?.plan, 'sync') + const executionTimeout = getExecutionTimeout( + userSubscription?.plan as SubscriptionPlan | undefined, + 'sync' + ) const result = await Promise.race([ mcpService.executeTool(userId, serverId, toolCall, workspaceId), diff --git a/apps/sim/lib/execution/preprocessing.ts b/apps/sim/lib/execution/preprocessing.ts index f14b78e2d..9a0236fd1 100644 --- a/apps/sim/lib/execution/preprocessing.ts +++ b/apps/sim/lib/execution/preprocessing.ts @@ -6,6 +6,7 @@ import { checkServerSideUsageLimits } from '@/lib/billing/calculations/usage-mon import { getHighestPrioritySubscription } from '@/lib/billing/core/subscription' import { getExecutionTimeout } from '@/lib/core/execution-limits' import { RateLimiter } from '@/lib/core/rate-limiter/rate-limiter' +import type { SubscriptionPlan } from '@/lib/core/rate-limiter/types' import { LoggingSession } from '@/lib/logs/execution/logging-session' import { getWorkspaceBilledAccountUserId } from '@/lib/workspaces/utils' import type { CoreTriggerType } from '@/stores/logs/filters/types' @@ -489,7 +490,7 @@ export async function preprocessExecution( triggerType, }) - const plan = userSubscription?.plan + const plan = userSubscription?.plan as SubscriptionPlan | undefined return { success: true, actorUserId,