Toolset<TDeps> interface can be plugged into any Vibes agent — no special framework coupling required.
The three toolsets bundled inside
@vibesjs/sdk (TodoToolset, SkillsToolset, MemoryToolset) follow exactly the same patterns described here. They are community contributions that were promoted into the core package. Your own published toolset is structurally identical.What makes a good toolset
A toolset is a good candidate for extraction if it:- Groups tools that share a single domain (task tracking, web browsing, file I/O, etc.)
- Maintains its own state that benefits from a replaceable storage interface
- Can be configured with options that vary across deployments
- Has no hard dependency on a specific agent or model
Anatomy of a published toolset
deno.json (JSR)
package.json with "exports" pointing at the compiled entry.
mod.ts — public surface
types.ts — interfaces
Define a storage interface so consumers can swap in their own persistence layer:
store.ts — default in-memory implementation
toolset.ts — the toolset class
Publishing to JSR
Publishing to npm
Compile to JavaScript (e.g. withdeno bundle or esbuild), then:
Guidelines for toolset authors
Naming
- Package name:
@scope/vibes-<domain>-toolset(e.g.@acme/vibes-crm-toolset) - Tool names:
snake_casewith a descriptive verb prefix (e.g.crm_search,crm_update) - Avoid generic names like
searchorget— they collide with other toolsets
Storage interfaces
Always define a<Domain>Store interface and provide a default InMemory<Domain>Store. This lets consumers plug in Redis, PostgreSQL, or any other store without forking your code.
Generic over TDeps
Make your toolset class generic over TDeps even if the tools themselves do not use ctx.deps:
Dependency injection
If your tools need runtime configuration (API keys, base URLs), accept them through the constructor — never hardcode or read directly fromDeno.env inside the toolset. Let the consumer decide how configuration is supplied.
Error handling
Return structured error strings fromexecute rather than throwing for expected failures (tool not found, empty result). Throw for unexpected/unrecoverable errors only — the SDK will propagate those to the caller.
Testing
UseTestModel from @vibesjs/sdk to write unit tests without making real model calls:
Documentation
- Write a
README.mdwith a quick-start example - Document every tool name, parameter, and return value
- Note provider or runtime dependencies (e.g. “requires Deno”, “requires a browser environment”)
Contributing to the bundled community toolsets
The three toolsets bundled inside@vibesjs/sdk live in packages/sdk/community/ in the vibes repository. To add a new bundled toolset:
- Create
packages/sdk/community/<name>/withtypes.ts, implementation, andmod.ts. - Export from
packages/sdk/community/mod.tsandpackages/sdk/mod.ts. - Add tests in
packages/sdk/tests/community_<name>_test.ts. - Add a doc page at
packages/sdk/docs/community/<name>.mdx. - Open a PR with the title
feat(community): add <YourToolset>.
Community Overview
Available bundled community toolsets
Built-in Toolsets
Core SDK toolset classes and their APIs
TodoToolset
Example of a well-structured community toolset
MemoryToolset
Example of a toolset with a pluggable store