(
tool fantasy.AgentTool,
mode database.NullChatPlanMode,
parentChatID uuid.NullUUID,
approvedMCPConfigIDs map[uuid.UUID]struct{},
)
| 6549 | } |
| 6550 | |
| 6551 | func toolAllowedForTurn( |
| 6552 | tool fantasy.AgentTool, |
| 6553 | mode database.NullChatPlanMode, |
| 6554 | parentChatID uuid.NullUUID, |
| 6555 | approvedMCPConfigIDs map[uuid.UUID]struct{}, |
| 6556 | ) bool { |
| 6557 | if !mode.Valid || mode.ChatPlanMode != database.ChatPlanModePlan { |
| 6558 | return true |
| 6559 | } |
| 6560 | if builtinPlanToolAllowed(tool.Info().Name, !parentChatID.Valid) { |
| 6561 | return true |
| 6562 | } |
| 6563 | mcpTool, ok := tool.(mcpclient.MCPToolIdentifier) |
| 6564 | if !ok { |
| 6565 | return false |
| 6566 | } |
| 6567 | _, approved := approvedMCPConfigIDs[mcpTool.MCPServerConfigID()] |
| 6568 | return approved |
| 6569 | } |
| 6570 | |
| 6571 | func filterToolsForTurn( |
| 6572 | allTools []fantasy.AgentTool, |
no test coverage detected