validateEngineMCPToolTimeout validates optional engine.mcp.tool-timeout configuration. The value must be a valid Go duration string between 10s and 600s inclusive.
(workflowData *WorkflowData)
| 199 | // validateEngineMCPToolTimeout validates optional engine.mcp.tool-timeout configuration. |
| 200 | // The value must be a valid Go duration string between 10s and 600s inclusive. |
| 201 | func (c *Compiler) validateEngineMCPToolTimeout(workflowData *WorkflowData) error { |
| 202 | if workflowData == nil || workflowData.EngineConfig == nil || workflowData.EngineConfig.MCPToolTimeout == "" { |
| 203 | return nil |
| 204 | } |
| 205 | |
| 206 | raw := workflowData.EngineConfig.MCPToolTimeout |
| 207 | |
| 208 | d, err := time.ParseDuration(raw) |
| 209 | if err != nil { |
| 210 | return fmt.Errorf("engine.mcp.tool-timeout: invalid duration %q. Must be a valid Go duration string (e.g. \"30s\", \"2m\", \"10m\").\n\nExamples:\n engine:\n mcp:\n tool-timeout: 2m\n\nSee: %s", raw, constants.DocsEnginesURL) |
| 211 | } |
| 212 | |
| 213 | if d < constants.MCPToolTimeoutMin { |
| 214 | return fmt.Errorf("engine.mcp.tool-timeout: %q is too short (minimum is 10s).\n\nExamples:\n tool-timeout: 30s\n tool-timeout: 2m\n\nSee: %s", raw, constants.DocsEnginesURL) |
| 215 | } |
| 216 | |
| 217 | if d > constants.MCPToolTimeoutMax { |
| 218 | return fmt.Errorf("engine.mcp.tool-timeout: %q exceeds the maximum allowed value (600s / 10m).\n\nExamples:\n tool-timeout: 2m\n tool-timeout: 10m\n\nSee: %s", raw, constants.DocsEnginesURL) |
| 219 | } |
| 220 | |
| 221 | engineValidationLog.Printf("engine.mcp.tool-timeout validated: %s (%s)", raw, d) |
| 222 | return nil |
| 223 | } |
| 224 | |
| 225 | // validateEngineInlineDefinition validates an inline engine definition parsed from |
| 226 | // engine.runtime + optional engine.provider in the workflow frontmatter. |