MCPcopy
hub / github.com/simstudioai/sim / resolveToolScope

Function resolveToolScope

apps/sim/tools/index.ts:57–77  ·  view source on GitHub ↗
(
  params: Record<string, unknown>,
  executionContext?: ExecutionContext
)

Source from the content-addressed store, hash-verified

55}
56
57function resolveToolScope(
58 params: Record<string, unknown>,
59 executionContext?: ExecutionContext
60): ToolExecutionScope {
61 const ctx = params._context as Record<string, unknown> | undefined
62 return {
63 workspaceId: (executionContext?.workspaceId ?? ctx?.workspaceId) as string | undefined,
64 workflowId: (executionContext?.workflowId ?? ctx?.workflowId) as string | undefined,
65 userId: (executionContext?.userId ?? ctx?.userId) as string | undefined,
66 executionId: (executionContext?.executionId ?? ctx?.executionId) as string | undefined,
67 callChain: (executionContext?.callChain ?? ctx?.callChain) as string[] | undefined,
68 isDeployedContext: (executionContext?.isDeployedContext ?? ctx?.isDeployedContext) as
69 | boolean
70 | undefined,
71 enforceCredentialAccess: (executionContext?.enforceCredentialAccess ??
72 ctx?.enforceCredentialAccess) as boolean | undefined,
73 copilotToolExecution: (executionContext?.copilotToolExecution ?? ctx?.copilotToolExecution) as
74 | boolean
75 | undefined,
76 }
77}
78
79function toUserFileFromWorkspaceRecord(record: {
80 id: string

Callers 6

injectHostedKeyIfNeededFunction · 0.85
reacquireHostedKeyFunction · 0.85
processHostedKeyCostFunction · 0.85
executeToolFunction · 0.85
executeMcpToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected