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

    Copy
    run(
      self,
      tool_input: str | dict[str, Any],
      verbose
    View source on GitHub
    :
    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'
    colorstr | None
    Default:'green'
    callbacksCallbacks
    Default:None
    tagslist[str] | None
    Default:None
    metadatadict[str, Any] | None
    Default:None
    run_namestr | None
    Default:None
    run_iduuid.UUID | None
    Default:None
    configRunnableConfig | None
    Default:None
    tool_call_idstr | None
    Default:None
    **kwargsAny
    Default:{}

    Run the tool.

    The color to use when starting the tool.

    The color to use when ending the tool.

    Callbacks to be called during tool execution.

    Optional list of tags associated with the tool.

    Optional metadata associated with the tool.

    The name of the run.

    The id of the run.

    The configuration for the tool.

    The id of the tool call.

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