Skip to content

Commit 7e4616e

Browse files
Update pkg/github/server.go
Co-authored-by: Copilot <[email protected]>
1 parent 8e49c3f commit 7e4616e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/github/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,13 @@ func OptionalIntParamWithDefault(r mcp.CallToolRequest, p string, d int) (int, e
147147
// OptionalBoolParamWithDefault is a helper function that can be used to fetch a requested parameter from the request
148148
// similar to optionalBoolParam, but it also takes a default value.
149149
func OptionalBoolParamWithDefault(r mcp.CallToolRequest, p string, d bool) (bool, error) {
150+
args := r.GetArguments()
151+
_, ok := args[p]
150152
v, err := OptionalParam[bool](r, p)
151153
if err != nil {
152154
return false, err
153155
}
154-
if !v {
156+
if !ok {
155157
return d, nil
156158
}
157159
return v, nil

0 commit comments

Comments
 (0)