Skip to content
masterclass Buddy

LangChain · Class

ToolMessage

ToolMessage sends a tool's result back to a chat model. Use tool_call_id to match the result with the tool request.

Last updated

Since
v1.7

Syntax

ToolMessage(self, content: str | list[str | dict[Any, Any]], tool_call_id: str, *, artifact: Any = None, status: Literal['success', 'error'] = 'success', content_blocks: list[types.ContentBlock] | None = None, kwargs: Any = {})

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseMessage
  • ToolOutputMixin
  • content_blocks
  • artifact
  • tool_call_id

Source: ToolMessage | langchain_core. Checked 2026-11-03.