Skip to content

Commit 9cd09fd

Browse files
authored
docs(plugins): note the factory tool execute signature (#120097)
* docs(plugins): note the factory tool execute signature * docs(plugins): state the factory tool result and execute signature precisely
1 parent ab013fa commit 9cd09fd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎docs/plugins/tool-plugins.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ account, thread, and local-media policy; plugins cannot retarget this helper,
161161
and retained copies stop working after the turn closes. The helper is unavailable
162162
for channels whose delivery is owned by a Gateway transport.
163163

164+
A factory may return a core `AgentTool`, an array of them, or `null` or
165+
`undefined` to opt out, as the example above does. When it returns a concrete
166+
tool, that tool uses the core runtime signature
167+
`execute(toolCallId, params, signal?, onUpdate?)` with the tool call ID first.
168+
That is the opposite argument order from the declarative
169+
`execute(params, config, context)` shown above, and it matches the
170+
`api.registerTool` examples in [Building Plugins](/plugins/building-plugins).
171+
Reading `params` from the first argument of a factory tool returns the tool
172+
call ID string instead.
173+
164174
Factories still declare a fixed tool name up front. Use `definePluginEntry`
165175
directly when the plugin computes tool names dynamically or combines tools
166176
with hooks, services, providers, or commands.

0 commit comments

Comments
 (0)