hasNonFormParams reports whether the call carries any parameter the tool's MCP App form cannot represent (anything outside formParams). Such calls must bypass the form and execute directly so the supplied values aren't silently dropped. formParams is the set of parameters the form collects and re-se
(args map[string]any, formParams map[string]struct{})
| 48 | // dropped. formParams is the set of parameters the form collects and re-sends |
| 49 | // on submit. |
| 50 | func hasNonFormParams(args map[string]any, formParams map[string]struct{}) bool { |
| 51 | for key, value := range args { |
| 52 | if value == nil { |
| 53 | continue |
| 54 | } |
| 55 | if _, ok := formParams[key]; !ok { |
| 56 | return true |
| 57 | } |
| 58 | } |
| 59 | return false |
| 60 | } |
| 61 | |
| 62 | // shouldDeferToForm is the single source of truth for the show/defer decision |
| 63 | // shared by the form-backed write tools (create_pull_request, |
no outgoing calls