File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -302,16 +302,17 @@ For complete reference:
302302 if filterObj , exists := args ["filter" ]; exists && filterObj != nil {
303303 // Marshal then unmarshal to our struct for type safety
304304 filterBytes , marshalErr := json .Marshal (filterObj )
305- if marshalErr == nil {
306- var f componentFilter
307- if unmarshalErr := json .Unmarshal (filterBytes , & f ); unmarshalErr == nil {
308- filterInput = & f
309- }
305+ if marshalErr != nil {
306+ return mcp .NewToolResultErrorFromErr ("failed to marshal filter argument" , marshalErr ), nil
310307 }
308+ var f componentFilter
309+ if unmarshalErr := json .Unmarshal (filterBytes , & f ); unmarshalErr != nil {
310+ return mcp .NewToolResultErrorFromErr ("failed to unmarshal filter argument" , unmarshalErr ), nil
311+ }
312+ filterInput = & f
311313 }
312314
313315 if filterInput != nil {
314- // Convert to ServiceFilterInput for the API
315316 serviceFilter , convertErr := convertToServiceFilterInput (* filterInput )
316317 if convertErr != nil {
317318 return mcp .NewToolResultErrorFromErr ("failed to convert filter" , convertErr ), nil
You can’t perform that action at this time.
0 commit comments