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

    Convert a Runnable into a BaseTool.

    Copy
    convert_runnable_to_tool(
      runnable: Runnable,
      args_schema: type[BaseModel] | None = None,
      *,
      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

    The name of the tool.

    descriptionstr | None
    Default:None

    The description of the tool.

    arg_typesdict[str, type] | None
    Default:None

    The types of the arguments.

    View source on GitHub