LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/coretoolsStructuredToolInterface
Interface●Since v0.3

StructuredToolInterface

Copy
interface StructuredToolInterface

Bases

RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage>

Properties

Methods

Inherited fromRunnableInterface

Properties

Plc_serializable: booleanPlc_id: string[]

Methods

Mbatch→ Promise<RunOutput[]>
—

Default implementation of batch, which calls invoke N times.

M
View source on GitHub
getName
→ string
Minvoke→ Promise<RunOutput>
—

Method to invoke the document transformation. This method calls the

Mstream→ Promise<IterableReadableStream<RunOutput>>
—

Stream output in chunks.

Mtransform→ AsyncGenerator<RunOutput>
—

Default implementation of transform, which buffers input and then calls stream.

Inherited fromSerializableInterface

Properties

Plc_id: string[]
property
description: string
property
extras: Record<string, unknown>
property
lc_namespace: string[]
property
lc_serializable: boolean
property
name: string
property
returnDirect: boolean
property
lc_id: string[]
deprecatedproperty
schema: SchemaT
method
batch→ Promise<RunOutput[]>
method
getName→ string
method
invoke→ Promise<RunOutput>
method
stream→ Promise<IterableReadableStream<RunOutput>>
method
transform→ AsyncGenerator<RunOutput>
deprecatedmethod
call→ Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>

Interface that defines the shape of a LangChain structured tool.

A structured tool is a tool that uses a schema to define the structure of the arguments that the LLM generates as part of its ToolCall.

A description of what the function does, used by the model to choose when and how to call the function.

Optional provider-specific extra fields for the tool.

This is used to pass provider-specific configuration that doesn't fit into standard tool fields.

A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.

Whether to return the tool's output directly.

Setting this to true means that after the tool is called, an agent should stop looping.

Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently.

Method to invoke the document transformation. This method calls the transformDocuments method with the provided input.

Stream output in chunks.

Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated.