(
allTools []fantasy.AgentTool,
mode database.NullChatPlanMode,
parentChatID uuid.NullUUID,
approvedMCPConfigIDs map[uuid.UUID]struct{},
)
| 6569 | } |
| 6570 | |
| 6571 | func filterToolsForTurn( |
| 6572 | allTools []fantasy.AgentTool, |
| 6573 | mode database.NullChatPlanMode, |
| 6574 | parentChatID uuid.NullUUID, |
| 6575 | approvedMCPConfigIDs map[uuid.UUID]struct{}, |
| 6576 | ) []fantasy.AgentTool { |
| 6577 | if !mode.Valid || mode.ChatPlanMode != database.ChatPlanModePlan { |
| 6578 | return allTools |
| 6579 | } |
| 6580 | |
| 6581 | filtered := make([]fantasy.AgentTool, 0, len(allTools)) |
| 6582 | for _, tool := range allTools { |
| 6583 | if toolAllowedForTurn(tool, mode, parentChatID, approvedMCPConfigIDs) { |
| 6584 | filtered = append(filtered, tool) |
| 6585 | } |
| 6586 | } |
| 6587 | return filtered |
| 6588 | } |
| 6589 | |
| 6590 | // activeToolNamesForTurn extends the built-in plan allowlist with approved |
| 6591 | // external MCP tools for root plan-mode chats. |
no test coverage detected