workflowHasAwContextInput reports whether the workflow identified by fileResult has aw_context declared in its workflow_dispatch.inputs.
(fileResult *findWorkflowFileResult, workflowName string)
| 71 | // workflowHasAwContextInput reports whether the workflow identified by fileResult |
| 72 | // has aw_context declared in its workflow_dispatch.inputs. |
| 73 | func workflowHasAwContextInput(fileResult *findWorkflowFileResult, workflowName string) bool { |
| 74 | var inputs map[string]any |
| 75 | var err error |
| 76 | |
| 77 | if fileResult.lockExists { |
| 78 | inputs, err = extractWorkflowDispatchInputs(fileResult.lockPath) |
| 79 | } else if fileResult.ymlExists { |
| 80 | inputs, err = extractWorkflowDispatchInputs(fileResult.ymlPath) |
| 81 | } else if fileResult.mdExists { |
| 82 | inputs, err = extractMDWorkflowDispatchInputs(fileResult.mdPath) |
| 83 | } else { |
| 84 | return false |
| 85 | } |
| 86 | if err != nil { |
| 87 | safeOutputsConfigLog.Printf("Warning: error extracting inputs for %s: %v", workflowName, err) |
| 88 | return false |
| 89 | } |
| 90 | _, hasAwContext := inputs["aw_context"] |
| 91 | return hasAwContext |
| 92 | } |
| 93 | |
| 94 | // generateDispatchWorkflowTool generates an MCP tool definition for a specific workflow. |
| 95 | // The tool will be named after the workflow (normalized to underscores) and accept |
no test coverage detected