@@ -53,6 +53,7 @@ import {
5353import type { ProviderId , ProviderToolConfig } from '@/providers/types'
5454import { useProvidersStore } from '@/stores/providers/store'
5555import { mergeToolParameters } from '@/tools/merge-params'
56+ import type { WorkflowToolExecutionContext } from '@/tools/types'
5657
5758const logger = createLogger ( 'ProviderUtils' )
5859
@@ -629,6 +630,7 @@ export async function transformBlockTool(
629630 getTool : ( toolId : string ) => any
630631 getToolAsync ?: ( toolId : string ) => Promise < any >
631632 canonicalModes ?: Record < string , 'basic' | 'advanced' >
633+ enrichmentContext ?: WorkflowToolExecutionContext
632634 /**
633635 * Server-only resolver for a custom (deploy-as-block) tool's binding (bound
634636 * workflow + input schema), org-scoped to the consumer. Injected as a dependency
@@ -646,8 +648,15 @@ export async function transformBlockTool(
646648 toolIndex ?: number
647649 }
648650) : Promise < ProviderToolConfig | null > {
649- const { selectedOperation, getAllBlocks, getTool, getToolAsync, canonicalModes, toolIndex } =
650- options
651+ const {
652+ selectedOperation,
653+ getAllBlocks,
654+ getTool,
655+ getToolAsync,
656+ canonicalModes,
657+ enrichmentContext,
658+ toolIndex,
659+ } = options
651660 const scopedCanonicalModes = scopeCanonicalModesForTool ( canonicalModes , toolIndex , block . type )
652661
653662 const blockDef = getAllBlocks ( ) . find ( ( b : any ) => b . type === block . type )
@@ -755,12 +764,6 @@ export async function transformBlockTool(
755764
756765 const userProvidedParams = block . params || { }
757766
758- const {
759- schema : llmSchema ,
760- enrichedDescription,
761- modelBlockedParams,
762- } = await createLLMToolSchema ( toolConfig , userProvidedParams )
763-
764767 const canonicalGroups : CanonicalGroup [ ] = blockDef ?. subBlocks
765768 ? Object . values ( buildCanonicalIndex ( blockDef . subBlocks ) . groupsById ) . filter ( isCanonicalPair )
766769 : [ ]
@@ -771,6 +774,12 @@ export async function transformBlockTool(
771774 scopedCanonicalModes
772775 )
773776
777+ const {
778+ schema : llmSchema ,
779+ enrichedDescription,
780+ modelBlockedParams,
781+ } = await createLLMToolSchema ( toolConfig , resolvedResourceParams , enrichmentContext )
782+
774783 let uniqueToolId = toolConfig . id
775784 let toolName = toolConfig . name
776785 let toolDescription = enrichedDescription || toolConfig . description
0 commit comments