File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1552,11 +1552,13 @@ async function executeMcpTool(
15521552
15531553 const baseUrl = getInternalApiBaseUrl ( )
15541554
1555+ const mcpScope = resolveToolScope ( params , executionContext )
1556+
15551557 const headers : Record < string , string > = { 'Content-Type' : 'application/json' }
15561558
15571559 if ( typeof window === 'undefined' ) {
15581560 try {
1559- const internalToken = await generateInternalToken ( executionContext ? .userId )
1561+ const internalToken = await generateInternalToken ( mcpScope . userId )
15601562 headers . Authorization = `Bearer ${ internalToken } `
15611563 } catch ( error ) {
15621564 logger . error ( `[${ actualRequestId } ] Failed to generate internal token:` , error )
@@ -1587,8 +1589,6 @@ async function executeMcpTool(
15871589 )
15881590 }
15891591
1590- const mcpScope = resolveToolScope ( params , executionContext )
1591-
15921592 if ( mcpScope . callChain && mcpScope . callChain . length > 0 ) {
15931593 headers [ SIM_VIA_HEADER ] = serializeCallChain ( mcpScope . callChain )
15941594 }
You can’t perform that action at this time.
0 commit comments