mirror of
https://github.com/taigrr/gotify-mcp.git
synced 2025-10-23 01:27:18 +03:00
update interface => any
This commit is contained in:
15
main.go
15
main.go
@@ -18,14 +18,14 @@ type GotifyMessage struct {
|
|||||||
Priority int `json:"priority,omitempty"`
|
Priority int `json:"priority,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStringArg(args map[string]interface{}, key string, defaultValue string) string {
|
func getStringArg(args map[string]any, key string, defaultValue string) string {
|
||||||
if val, ok := args[key].(string); ok {
|
if val, ok := args[key].(string); ok {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
return defaultValue
|
return defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNumberArg(args map[string]interface{}, key string, defaultValue float64) float64 {
|
func getNumberArg(args map[string]any, key string, defaultValue float64) float64 {
|
||||||
if val, ok := args[key].(float64); ok {
|
if val, ok := args[key].(float64); ok {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ func sendMessage(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToo
|
|||||||
return mcp.NewToolResultError(err.Error()), nil
|
return mcp.NewToolResultError(err.Error()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
args, ok := request.Params.Arguments.(map[string]interface{})
|
args, ok := request.Params.Arguments.(map[string]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return mcp.NewToolResultError("invalid arguments type"), nil
|
return mcp.NewToolResultError("invalid arguments type"), nil
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ func askForHelp(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallTool
|
|||||||
return mcp.NewToolResultError(err.Error()), nil
|
return mcp.NewToolResultError(err.Error()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
args, ok := request.Params.Arguments.(map[string]interface{})
|
args, ok := request.Params.Arguments.(map[string]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return mcp.NewToolResultError("invalid arguments type"), nil
|
return mcp.NewToolResultError("invalid arguments type"), nil
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ func notifyCompletion(ctx context.Context, request mcp.CallToolRequest) (*mcp.Ca
|
|||||||
return mcp.NewToolResultError(err.Error()), nil
|
return mcp.NewToolResultError(err.Error()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
args, ok := request.Params.Arguments.(map[string]interface{})
|
args, ok := request.Params.Arguments.(map[string]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return mcp.NewToolResultError("invalid arguments type"), nil
|
return mcp.NewToolResultError("invalid arguments type"), nil
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ func summarizeActivity(ctx context.Context, request mcp.CallToolRequest) (*mcp.C
|
|||||||
return mcp.NewToolResultError(err.Error()), nil
|
return mcp.NewToolResultError(err.Error()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
args, ok := request.Params.Arguments.(map[string]interface{})
|
args, ok := request.Params.Arguments.(map[string]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return mcp.NewToolResultError("invalid arguments type"), nil
|
return mcp.NewToolResultError("invalid arguments type"), nil
|
||||||
}
|
}
|
||||||
@@ -244,4 +244,5 @@ func summarizeActivity(ctx context.Context, request mcp.CallToolRequest) (*mcp.C
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mcp.NewToolResultText("Activity summary sent successfully"), nil
|
return mcp.NewToolResultText("Activity summary sent successfully"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user