jsr:@vibesjs/sdk. All implement the Toolset<TDeps> interface and can be passed in the toolsets array when constructing an Agent.
Summary
FunctionToolset
The simplest toolset: wraps an array ofToolDefinition objects. Use it when you have a fixed set of tools that do not need dynamic filtering.
FilteredToolset
Wraps an inner toolset with a per-turn boolean predicate. When the predicate returnsfalse the entire inner toolset is hidden from the model for that turn. When it returns true the full inner toolset is exposed.
This is an all-or-nothing gate. For per-tool filtering, use PreparedToolset.
PreparedToolset
Wraps an inner toolset with aprepare function that runs once per turn. Unlike FilteredToolset, which hides the entire set, PreparedToolset can add, remove, or reorder individual tools.
PrefixedToolset
Adds a string prefix to every tool name in the wrapped toolset. Useful when composing two toolsets that define tools with the same name.RenamedToolset
Renames specific tools using a{ oldName: newName } mapping. Tools whose names are not in the map are passed through unchanged.
WrapperToolset
An abstract base class that intercepts every tool execution in the wrapped toolset. Subclass it and implementcallTool to add cross-cutting behaviour: logging, metrics, rate limiting, argument transformation, or result transformation.
next(ctx, args) to invoke the underlying tool. You may modify args before forwarding or transform the return value afterward.
CombinedToolset
Merges any number of toolsets into one. Tools are collected from all members on each turn. When two toolsets expose a tool with the same name, the last one in the constructor argument list wins.ApprovalRequiredToolset
Wraps a toolset and setsrequiresApproval: true on every tool inside it. When the model calls any of these tools, the run pauses and throws ApprovalRequiredError with a DeferredToolRequests object.
ExternalToolset
For tools whose execution happens outside the agent process — in the browser, a sandboxed environment, or a remote service. The agent is shown the tools and can call them; each call pauses the run and throwsApprovalRequiredError so the caller can execute the tool externally and return results.
Uses raw JSON Schema instead of Zod for parameter validation.
MCPToolset
Wraps a singleMCPClient and adapts it to the Toolset interface. Tools are fetched lazily on the first call to tools() and cached for toolCacheTtlMs milliseconds.
MCPManager and config-file loading.
MCPManager
Manages multiple MCP server connections, connects them in parallel, and merges their tools into a single flat list. ImplementsToolset directly — pass it to an agent without further wrapping.
MCPManager and MCPToolset live in the MCP module but are re-exported from the main jsr:@vibesjs/sdk entry point alongside the other toolsets.Toolsets
Per-turn tool resolution and composition overview
Tool Patterns
Advanced patterns: conditional tools, approval flows, sequential tools
MCP Client
Full guide to connecting MCP servers
Human-in-the-Loop
Handling ApprovalRequiredError and resuming runs