# Class ExitLoopTool

java.lang.Object
com.google.adk.tools.ExitLoopTool

public final class ExitLoopTool extends Object
Tool for exiting execution of `LoopAgent`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final FunctionTool`
  `INSTANCE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `exitLoop(ToolContext toolContext)`
  Exit the `LoopAgent` execution.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INSTANCE

    public static final FunctionTool INSTANCE

- ## Method Details

  - ### exitLoop

    public static void exitLoop(ToolContext toolContext)
    Exit the `LoopAgent` execution.

    Usage example in an LlmAgent:

        LlmAgent subAgent = LlmAgent.builder()
            .addTool(ExitLoopTool.INSTANCE)
            .build();

    The @Schema name and description is consistent with the Python version.

    Refer to: https://github.com/google/adk-python/blob/main/src/google/adk/tools/exit_loop_tool.py