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

Function generateToolDefinition

apps/sim/lib/mcp/workflow-tool-schema.ts:287–299  ·  view source on GitHub ↗
(
  workflowName: string,
  workflowDescription: string | undefined | null,
  inputFormat: InputFormatField[],
  customToolName?: string,
  customDescription?: string
)

Source from the content-addressed store, hash-verified

285 * Generate a complete MCP tool definition from workflow metadata and input format.
286 */
287export function generateToolDefinition(
288 workflowName: string,
289 workflowDescription: string | undefined | null,
290 inputFormat: InputFormatField[],
291 customToolName?: string,
292 customDescription?: string
293): McpToolDefinition {
294 return {
295 name: customToolName || sanitizeToolName(workflowName),
296 description: customDescription || workflowDescription || `Execute ${workflowName} workflow`,
297 inputSchema: generateToolInputSchema(inputFormat),
298 }
299}
300
301/**
302 * Extract input format from a workflow's blocks.

Callers

nothing calls this directly

Calls 2

sanitizeToolNameFunction · 0.85
generateToolInputSchemaFunction · 0.85

Tested by

no test coverage detected