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-coretoolsbaseBaseToolrun
    Method●Since v0.2

    run

    Run the tool.

    Copy
    run(
      self,
      tool_input: str | dict[str, Any],
      verbose: bool | None = None,
      start_color: str | None = 'green',
      color: str | None = 'green',
      callbacks: Callbacks = None,
      *,
      tags: list[str] | None = None,
      metadata: dict[str, Any] | None = None,
      run_name: str | None = None,
      run_id: uuid.UUID | None = None,
      config: RunnableConfig | None = None,
      tool_call_id: str | None = None,
      **kwargs: Any = {}
    ) -> Any

    Parameters

    NameTypeDescription
    tool_input*str | dict[str, Any]

    The input to the tool.

    verbosebool | None
    Default:None

    Whether to log the tool's progress.

    start_colorstr | None
    Default:'green'

    The color to use when starting the tool.

    colorstr | None
    Default:'green'

    The color to use when ending the tool.

    callbacksCallbacks
    Default:None

    Callbacks to be called during tool execution.

    tagslist[str] | None
    Default:None

    Optional list of tags associated with the tool.

    metadatadict[str, Any] | None
    Default:None

    Optional metadata associated with the tool.

    run_namestr | None
    Default:None

    The name of the run.

    run_iduuid.UUID | None
    Default:None

    The id of the run.

    configRunnableConfig | None
    Default:None

    The configuration for the tool.

    tool_call_idstr | None
    Default:None

    The id of the tool call.

    **kwargsAny
    Default:{}

    Keyword arguments to be passed to tool callbacks (event handler)

    View source on GitHub