@@ -411,6 +411,12 @@ func (s *Server) RegisterGameManagementTools(gamesConfig *config.GamesConfig, ba
411411
412412 status := s .checkGameStatus (game .ID )
413413 validationWarnings := gameValidationWarnings (* game )
414+ if len (validationWarnings ) > 0 {
415+ content .WriteString ("\n Configuration Warnings:\n " )
416+ for _ , warning := range validationWarnings {
417+ content .WriteString (fmt .Sprintf (" - %s\n " , warning ))
418+ }
419+ }
414420 structured := map [string ]interface {}{
415421 "game" : gameConfigStructured (* game ),
416422 "status" : status ,
@@ -527,6 +533,7 @@ func (s *Server) RegisterGameManagementTools(gamesConfig *config.GamesConfig, ba
527533 }, nil
528534 }
529535
536+ validationWarnings := gameValidationWarnings (* game )
530537 startResult , err := s .startGame (* game , gamesConfig , backoffMin , backoffMax )
531538 if err != nil {
532539 var activeErr * gameAlreadyActiveError
@@ -536,14 +543,16 @@ func (s *Server) RegisterGameManagementTools(gamesConfig *config.GamesConfig, ba
536543 status = s .checkGameStatus (game .ID )
537544 }
538545 toolCount := len (s .getGameSpecificTools (game .ID ))
546+ structured := map [string ]interface {}{
547+ "gameId" : game .ID ,
548+ "status" : status ,
549+ "toolCount" : toolCount ,
550+ "nextActions" : s .nextActionsForGameStatus (* game , status , toolCount ),
551+ }
552+ addValidationWarnings (structured , validationWarnings )
539553 return & ToolResult {
540- Content : []Content {{Type : "text" , Text : activeErr .ToolMessage (* game )}},
541- StructuredContent : map [string ]interface {}{
542- "gameId" : game .ID ,
543- "status" : status ,
544- "toolCount" : toolCount ,
545- "nextActions" : s .nextActionsForGameStatus (* game , status , toolCount ),
546- },
554+ Content : []Content {{Type : "text" , Text : activeErr .ToolMessage (* game )}},
555+ StructuredContent : structured ,
547556 }, nil
548557 }
549558
@@ -559,39 +568,46 @@ func (s *Server) RegisterGameManagementTools(gamesConfig *config.GamesConfig, ba
559568 message = fmt .Sprintf ("%s: %v" , message , startResult .GABPConnectError )
560569 }
561570 message = fmt .Sprintf ("%s. The game may still be loading or the mod may be missing. Use games_status, then games_connect once the mod is ready." , message )
562- return & ToolResult {
563- Content : []Content {{Type : "text" , Text : message }},
564- StructuredContent : map [string ]interface {}{
565- "gameId" : game .ID ,
566- "processStarted" : startResult .ProcessStarted ,
567- "gabpConnected" : startResult .GABPConnected ,
568- "gameStillRunning" : startResult .GameStillRunning ,
569- "gabpWaitMs" : startResult .GABPConnectWait .Milliseconds (),
570- "gabpError" : func () interface {} {
571- if startResult .GABPConnectError == nil {
572- return nil
573- }
574- return startResult .GABPConnectError .Error ()
575- }(),
576- "nextActions" : []map [string ]interface {}{
577- mcpNextAction ("games_status" , map [string ]interface {}{"gameId" : game .ID }, "Verify whether the game is still running." ),
578- mcpNextAction ("games_connect" , map [string ]interface {}{"gameId" : game .ID }, "Connect after the mod finishes loading." ),
579- },
571+ message = appendValidationWarningText (message , validationWarnings )
572+ structured := map [string ]interface {}{
573+ "gameId" : game .ID ,
574+ "processStarted" : startResult .ProcessStarted ,
575+ "gabpConnected" : startResult .GABPConnected ,
576+ "gameStillRunning" : startResult .GameStillRunning ,
577+ "gabpWaitMs" : startResult .GABPConnectWait .Milliseconds (),
578+ "gabpError" : func () interface {} {
579+ if startResult .GABPConnectError == nil {
580+ return nil
581+ }
582+ return startResult .GABPConnectError .Error ()
583+ }(),
584+ "nextActions" : []map [string ]interface {}{
585+ mcpNextAction ("games_status" , map [string ]interface {}{"gameId" : game .ID }, "Verify whether the game is still running." ),
586+ mcpNextAction ("games_connect" , map [string ]interface {}{"gameId" : game .ID }, "Connect after the mod finishes loading." ),
580587 },
588+ }
589+ addValidationWarnings (structured , validationWarnings )
590+ return & ToolResult {
591+ Content : []Content {{Type : "text" , Text : message }},
592+ StructuredContent : structured ,
581593 }, nil
582594 }
583595
584- return & ToolResult {
585- Content : []Content {{Type : "text" , Text : fmt .Sprintf ("Game '%s' (%s) started successfully and connected via GABP." , game .ID , game .Name )}},
586- StructuredContent : map [string ]interface {}{
587- "gameId" : game .ID ,
588- "processStarted" : true ,
589- "gabpConnected" : true ,
590- "gameStillRunning" : true ,
591- "nextActions" : []map [string ]interface {}{
592- mcpNextAction ("games_tool_names" , map [string ]interface {}{"gameId" : game .ID , "brief" : true }, "Discover connected game-specific tools." ),
593- },
596+ message := fmt .Sprintf ("Game '%s' (%s) started successfully and connected via GABP." , game .ID , game .Name )
597+ message = appendValidationWarningText (message , validationWarnings )
598+ structured := map [string ]interface {}{
599+ "gameId" : game .ID ,
600+ "processStarted" : true ,
601+ "gabpConnected" : true ,
602+ "gameStillRunning" : true ,
603+ "nextActions" : []map [string ]interface {}{
604+ mcpNextAction ("games_tool_names" , map [string ]interface {}{"gameId" : game .ID , "brief" : true }, "Discover connected game-specific tools." ),
594605 },
606+ }
607+ addValidationWarnings (structured , validationWarnings )
608+ return & ToolResult {
609+ Content : []Content {{Type : "text" , Text : message }},
610+ StructuredContent : structured ,
595611 }, nil
596612 }, normalizationConfig )
597613
@@ -2084,13 +2100,33 @@ func gameConfigStructured(game config.GameConfig) map[string]interface{} {
20842100}
20852101
20862102func gameValidationWarnings (game config.GameConfig ) []string {
2087- warnings := make ([]string , 0 , 1 )
2103+ warnings := make ([]string , 0 , 2 )
20882104 if (game .LaunchMode == "SteamAppId" || game .LaunchMode == "EpicAppId" ) && game .StopProcessName == "" {
20892105 warnings = append (warnings , fmt .Sprintf ("%s games need stopProcessName for reliable games_stop and games_kill." , game .LaunchMode ))
20902106 }
2107+ if launcherModeIgnoresConfiguredArgs (game ) {
2108+ warnings = append (warnings , fmt .Sprintf ("%s launch mode does not pass configured args to the game; use DirectPath, CustomCommand, or the game launcher's own launch options for arguments such as -savedatafolder=..." , game .LaunchMode ))
2109+ }
20912110 return warnings
20922111}
20932112
2113+ func launcherModeIgnoresConfiguredArgs (game config.GameConfig ) bool {
2114+ return (game .LaunchMode == "SteamAppId" || game .LaunchMode == "EpicAppId" ) && len (game .Args ) > 0
2115+ }
2116+
2117+ func addValidationWarnings (structured map [string ]interface {}, warnings []string ) {
2118+ if len (warnings ) > 0 {
2119+ structured ["validationWarnings" ] = warnings
2120+ }
2121+ }
2122+
2123+ func appendValidationWarningText (message string , warnings []string ) string {
2124+ if len (warnings ) == 0 {
2125+ return message
2126+ }
2127+ return fmt .Sprintf ("%s Configuration warning: %s" , message , strings .Join (warnings , " " ))
2128+ }
2129+
20942130func (s * Server ) gameStatusStructured (game config.GameConfig , status string ) map [string ]interface {} {
20952131 toolCount := len (s .getGameSpecificTools (game .ID ))
20962132 item := map [string ]interface {}{
0 commit comments