activeToolNamesForTurn extends the built-in plan allowlist with approved external MCP tools for root plan-mode chats.
(
allTools []fantasy.AgentTool,
mode database.NullChatPlanMode,
parentChatID uuid.NullUUID,
approvedMCPConfigIDs map[uuid.UUID]struct{},
)
| 6590 | // activeToolNamesForTurn extends the built-in plan allowlist with approved |
| 6591 | // external MCP tools for root plan-mode chats. |
| 6592 | func activeToolNamesForTurn( |
| 6593 | allTools []fantasy.AgentTool, |
| 6594 | mode database.NullChatPlanMode, |
| 6595 | parentChatID uuid.NullUUID, |
| 6596 | approvedMCPConfigIDs map[uuid.UUID]struct{}, |
| 6597 | ) []string { |
| 6598 | toolNames := make([]string, 0, len(allTools)) |
| 6599 | for _, tool := range allTools { |
| 6600 | if toolAllowedForTurn(tool, mode, parentChatID, approvedMCPConfigIDs) { |
| 6601 | toolNames = append(toolNames, tool.Info().Name) |
| 6602 | } |
| 6603 | } |
| 6604 | return toolNames |
| 6605 | } |
| 6606 | |
| 6607 | func allowedExploreToolNames(allTools []fantasy.AgentTool) []string { |
| 6608 | builtinExplorePolicy := map[string]bool{ |