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

Function applyDescriptionOverrides

apps/sim/lib/mcp/workflow-tool-schema.ts:196–214  ·  view source on GitHub ↗
(
  baseSchema: Record<string, unknown>,
  overrides: Record<string, string> | null | undefined
)

Source from the content-addressed store, hash-verified

194 * the field name, matching the base converter's "no description" behavior.
195 */
196export function applyDescriptionOverrides(
197 baseSchema: Record<string, unknown>,
198 overrides: Record<string, string> | null | undefined
199): Record<string, unknown> {
200 if (!overrides || Object.keys(overrides).length === 0) return baseSchema
201 const baseProperties = baseSchema.properties as Record<string, McpToolProperty> | undefined
202 if (!baseProperties) return baseSchema
203
204 const properties: Record<string, McpToolProperty> = {}
205 for (const [name, property] of Object.entries(baseProperties)) {
206 const override = overrides[name]
207 properties[name] =
208 typeof override === 'string'
209 ? { ...property, description: override.trim() || name }
210 : property
211 }
212
213 return { ...baseSchema, properties }
214}
215
216/**
217 * Drop override entries whose parameter no longer exists in the base schema, so the stored override

Callers 4

executeDeployMcpFunction · 0.90
syncMcpToolsForWorkflowFunction · 0.90
prepareWorkflowMcpToolFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected