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-coretoolsconvertconvert_runnable_to_tool
    Functionā—Since v0.2

    convert_runnable_to_tool

    Copy
    convert_runnable_to_tool(
      runnable: Runnable,
      args_schema: type[BaseModel] | None = None,
      *,
      
    View source on GitHub
    name
    :
    str
    |
    None
    =
    None
    ,
    description
    :
    str
    |
    None
    =
    None
    ,
    arg_types
    :
    dict
    [
    str
    ,
    type
    ]
    |
    None
    =
    None
    )
    ->
    BaseTool

    Parameters

    NameTypeDescription
    runnable*Runnable

    The Runnable to convert.

    args_schematype[BaseModel] | None
    Default:None

    The schema for the tool's input arguments.

    namestr | None
    Default:None
    descriptionstr | None
    Default:None
    arg_typesdict[str, type] | None
    Default:None

    Convert a Runnable into a BaseTool.

    The name of the tool.

    The description of the tool.

    The types of the arguments.