LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corecallbacksfileFileCallbackHandleron_tool_end
    Method●Since v0.1

    on_tool_end

    Handle tool end by writing the output with optional prefixes.

    Copy
    on_tool_end(
      self,
      output: str,
      color: str | None = None,
      observation_prefix: str | None = None,
      llm_prefix: str | None = None,
      **kwargs: Any = {}
    ) -> None

    Parameters

    NameTypeDescription
    output*str

    The tool output to write.

    colorstr | None
    Default:None

    Color override for this specific output.

    If None, uses self.color.

    observation_prefixstr | None
    Default:None

    Optional prefix to write before the output.

    llm_prefixstr | None
    Default:None

    Optional prefix to write after the output.

    **kwargsAny
    Default:{}

    Additional keyword arguments.

    View source on GitHub