MCPcopy Index your code
hub / github.com/simstudioai/sim / getRegistrySchema

Function getRegistrySchema

apps/sim/executor/utils/block-data.ts:36–54  ·  view source on GitHub ↗
(block: SerializedBlock)

Source from the content-addressed store, hash-verified

34}
35
36function getRegistrySchema(block: SerializedBlock): OutputSchema | undefined {
37 const blockType = block.metadata?.id
38 if (!blockType) return undefined
39
40 const subBlocks = paramsToSubBlocks(block.config?.params)
41 const blockConfig = getBlock(blockType)
42 const isTriggerCapable = blockConfig ? hasTriggerCapability(blockConfig) : false
43 const triggerMode = Boolean(isTriggerBehavior(block) && isTriggerCapable)
44 const outputs = getEffectiveBlockOutputs(blockType, subBlocks, {
45 triggerMode,
46 preferToolOutputs: !triggerMode,
47 includeHidden: true,
48 }) as OutputSchema
49
50 if (!outputs || Object.keys(outputs).length === 0) {
51 return undefined
52 }
53 return outputs
54}
55
56export function getBlockSchema(block: SerializedBlock): OutputSchema | undefined {
57 return getRegistrySchema(block)

Callers 1

getBlockSchemaFunction · 0.85

Calls 5

getBlockFunction · 0.90
hasTriggerCapabilityFunction · 0.90
isTriggerBehaviorFunction · 0.90
getEffectiveBlockOutputsFunction · 0.90
paramsToSubBlocksFunction · 0.85

Tested by

no test coverage detected