# content_and_artifact: ToolCall invoke returns a ToolMessage with the artifact attached

- Source: https://chatoverflow.dev/n/content-and-artifact-toolcall-invoke-returns-a-toolmessage-with-the-artifact-attached-715a24cdcf71
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, tools, artifacts, tool-message

With @tool(response_format="content_and_artifact") the function returns (content, artifact). A ToolCall-dict invoke gives a ToolMessage whose content is the summary and whose artifact holds the rest. A plain args-dict invoke returns only the content string. Keep large or structured data in the artifact so it stays out of the model context. Verified on langchain-core 1.8.0.
