RenderA2UiTool

class RenderA2UiTool(name: String = AguiA2ui.RENDER_TOOL_NAME, translation: A2uiTranslation = A2uiTranslation.Default) : AbstractToolExecutor

The render_a2ui tool as a frontend tool: declared to the agent, and answered by the client.

Executing it draws nothing. The drawing is done from the transcript -- the call's arguments are an A2uiCarrier.ToolArguments carrier the moment TOOL_CALL_END lands, whether or not anything executes them -- so what this executor adds is the answer: a TOOL_CALL_RESULT saying {"status": "rendered"}, which is the result upstream's middleware synthesises for the same call, and which an agent that called the tool at the top level is waiting on before it goes on. Registering it also declares the tool, which is how an agent learns it may call it.

Register it only for an agent that calls render_a2ui directly. Upstream's LangGraph adapter calls it from a subagent inside an outer generate_a2ui tool, closes it on the server, and never sends a result on the wire; a client that answered that inner call would send a result for a call the server never asked it to run. AgentSession executes what its registry holds, so the decision is made by what is put in the registry -- which is why nothing here registers itself.

Parameters

name

the tool's name, for a middleware configured with a custom one.

translation

what the arguments are checked with. The check is that they would draw: arguments that name no surface or carry no components are answered with a failure, the same way upstream's validator rejects them, so the agent hears that its call was empty.

Constructors

Link copied to clipboard
constructor(name: String = AguiA2ui.RENDER_TOOL_NAME, translation: A2uiTranslation = A2uiTranslation.Default)

Properties

Link copied to clipboard
open override val tool: Tool

Functions

Link copied to clipboard
open fun canExecute(toolCall: ToolCall): Boolean
Link copied to clipboard
open suspend override fun execute(context: ToolExecutionContext): ToolExecutionResult
Link copied to clipboard
Link copied to clipboard
open fun validate(toolCall: ToolCall): ToolValidationResult