docs(tools): document ToolMessage.error in tool result examples - #2311
Open
contextablemark wants to merge 1 commit into
Open
docs(tools): document ToolMessage.error in tool result examples#2311contextablemark wants to merge 1 commit into
contextablemark wants to merge 1 commit into
Conversation
`ToolMessage.error` is documented on the messages concept page and in the JS, Python, and Ruby SDK references, but two pages omit it -- both pages an integration author is likely to work from. - concepts/tools.mdx: the Tool Results example showed only `content` + `toolCallId`. Adds a failure example alongside the existing success one, reusing the page's confirmAction / tool-123 scenario. - sdk/kotlin/core/types.mdx: the ToolMessage declaration omitted `error`, which the Kotlin SDK does have. Also corrects the name / toolCallId order to match the source. concepts/events.mdx was checked and left alone: ToolCallResultEvent has no `error` field in either SDK, so its property table is accurate. Refs #2306, #2226 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Python Preview PackagesVersion
Install with uvAdd the TestPyPI index to your [[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
explicit = trueThen install the packages you need: # Core SDK
uv add 'ag-ui-protocol==0.0.0.dev1785878373' --index testpypi
# Integrations (each already depends on the matching ag-ui-protocol preview)
uv add 'ag-ui-langgraph==0.0.0.dev1785878373' --index testpypi
uv add 'ag-ui-crewai==0.0.0.dev1785878373' --index testpypi
# NOTE: ag-ui-agent-spec depends on pyagentspec (git-only, not on PyPI).
# You will need to install pyagentspec separately from its git repo.
uv add 'ag-ui-agent-spec==0.0.0.dev1785878373' --index testpypi
uv add 'ag_ui_adk==0.0.0.dev1785878373' --index testpypi
uv add 'ag_ui_strands==0.0.0.dev1785878373' --index testpypiInstall with pippip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
ag-ui-protocol==0.0.0.dev1785878373
Commit: 72bb659 |
@ag-ui/a2a-middleware
@ag-ui/a2ui-middleware
@ag-ui/event-throttle-middleware
@ag-ui/mcp-apps-middleware
@ag-ui/mcp-middleware
@ag-ui/a2a
@ag-ui/adk
@ag-ui/ag2
@ag-ui/agno
@ag-ui/aws-strands
@ag-ui/claude-agent-sdk
@ag-ui/claude-managed-agents
@ag-ui/crewai
@ag-ui/langchain
@ag-ui/langgraph
@ag-ui/llamaindex
@ag-ui/mastra
@ag-ui/pydantic-ai
@ag-ui/vercel-ai-sdk
@ag-ui/watsonx
@ag-ui/a2ui-toolkit
create-ag-ui-app
@ag-ui/client
@ag-ui/core
@ag-ui/encoder
@ag-ui/proto
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ToolMessage.erroris documented on the messages concept page (messages.mdx:153,161) and in the JS, Python, and Ruby SDK references — but two pages omit it, and both are pages an integration author is likely to work from.concepts/tools.mdx— the Tool Results example showed onlycontent+toolCallId. Adds a failure example alongside the existing success one, reusing the page'sconfirmAction/tool-123scenario, plus two sentences on why the field matters.sdk/kotlin/core/types.mdx— theToolMessagedeclaration omittederror, which the Kotlin SDK does have (Types.kt:265-271, documented in its own KDoc). Also corrects thename/toolCallIdorder to match the source.Not hypothetical: #2226 → #2263 fixed both LangGraph adapters dropping this field, and #2306 tracks four more first-party adapters with the same one-line omission. #2226 flagged the docs inconsistency as a likely contributing cause; this is that fix, split out so it doesn't sit in the adapter PR.
concepts/events.mdxwas checked and deliberately left alone —ToolCallResultEventhas noerrorfield in either SDK (events.ts:147-153,events.py:181-189), so its property table is accurate. That's a protocol asymmetry, not a docs bug.Scoped to message shape only — no claim about how adapters map
erroronto a framework's error flag, since that isn't uniformly true until #2306's PRs land.Docs-only.
Refs #2306, #2226