npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@robota-sdk/agent-tools

v3.0.0-beta.76

Published

Tool registry and implementations for Robota SDK

Readme

@robota-sdk/agent-tools

Tool registry, tool creation infrastructure, 8 built-in CLI tools, sandbox execution ports, and sandbox workspace manifests for the Robota SDK.

Installation

npm install @robota-sdk/agent-tools

Peer dependency: @robota-sdk/agent-core

Quick Start

Create a Tool with Zod

import { createZodFunctionTool } from '@robota-sdk/agent-tools';
import { z } from 'zod';

const weatherTool = createZodFunctionTool({
  name: 'get_weather',
  description: 'Get current weather for a city',
  schema: z.object({
    city: z.string().describe('City name'),
  }),
  handler: async ({ city }) => ({
    data: JSON.stringify({ city, temperature: 22, condition: 'sunny' }),
  }),
});

Use Built-in Tools

import { bashTool, readTool, globTool, grepTool } from '@robota-sdk/agent-tools';
import { Robota } from '@robota-sdk/agent-core';

const agent = new Robota({
  name: 'DevAgent',
  aiProviders: [provider],
  defaultModel: { provider: 'anthropic', model: 'claude-sonnet-4-6' },
  tools: [bashTool, readTool, globTool, grepTool],
});

Built-in Tools (8)

| Export | Tool Name | Description | | --------------- | --------- | --------------------------------------------------------- | | bashTool | Bash | Execute shell commands via host process or sandbox client | | readTool | Read | Read file contents with line numbers (cat -n) | | writeTool | Write | Write content to a file (creates parent dirs) | | editTool | Edit | Replace a specific string in a file | | globTool | Glob | Find files matching a glob pattern (fast-glob) | | grepTool | Grep | Search file contents with regex patterns | | webFetchTool | WebFetch | Fetch URL content (HTML-to-text conversion) | | webSearchTool | WebSearch | Web search via Brave Search API |

Factory exports (createBashTool, createReadTool, createWriteTool, createEditTool) accept an optional sandboxClient. The default singleton exports keep host-local behavior.

Sandbox Execution

ISandboxClient is the provider-neutral execution-plane port used by sandbox-aware built-in tools:

import { E2BSandboxClient, createBashTool, createReadTool } from '@robota-sdk/agent-tools';
import { Sandbox } from 'e2b';

const e2b = await Sandbox.create();
const sandboxClient = new E2BSandboxClient({ sandbox: e2b });

const bashTool = createBashTool({ sandboxClient });
const readTool = createReadTool({ sandboxClient });

The package does not depend on E2B directly. E2BSandboxClient adapts an E2B-compatible object with commands.run, files.read, files.write, and optional createSnapshot, pause, connect, or factory methods supplied by the application. snapshot() returns a provider-owned resumable workspace reference; restore(snapshotId) hydrates the adapter from that reference. InMemorySandboxClient is available for deterministic tests and contract verification.

Workspace Manifests

IWorkspaceManifest declares the fresh sandbox workspace before a session starts. Paths are workspace-relative and cannot escape the target root.

import { applyWorkspaceManifest, E2BSandboxClient } from '@robota-sdk/agent-tools';
import { Sandbox } from 'e2b';

const sandbox = await Sandbox.create();
const sandboxClient = new E2BSandboxClient({ sandbox });

await applyWorkspaceManifest(sandboxClient, {
  entries: {
    'task.md': { type: 'file', content: 'Analyze this repository.\n' },
    repo: { type: 'gitRepo', url: 'https://github.com/example/project.git', ref: 'main' },
    output: { type: 'dir' },
  },
});

The generic applicator writes inline/local files, creates directories, and clones Git repositories through ISandboxClient. Cloud storage mount entries are part of the contract, but they return unsupported until a provider-specific adapter implements native mounting.

Edit and Write Safety

Recent file tool updates keep write/edit behavior atomic and make Edit tool results easier for higher layers to display. Atomic replacements preserve existing target mode bits, so executable scripts remain executable after Write or Edit updates. The Edit tool returns line metadata for changed regions, allowing the CLI to render concise context hunks instead of dumping full files or opaque summaries.

Tool Infrastructure

| Export | Description | | ------------------------ | ---------------------------------------------------------- | | ToolRegistry | Central tool registration and schema lookup | | FunctionTool | JS function tool with Zod schema validation | | createFunctionTool | Factory for creating function tools | | createZodFunctionTool | Factory with Zod validation and JSON Schema conversion | | OpenAPITool | Tool generated from OpenAPI specification | | createOpenAPITool | Factory for creating OpenAPI tools | | zodToJsonSchema | Converts Zod schemas to JSON Schema format | | TToolResult | Result type for built-in CLI tool invocations | | ISandboxClient | Provider-neutral sandbox execution port | | IWorkspaceManifest | Declarative sandbox workspace setup contract | | applyWorkspaceManifest | Generic manifest applicator for sandbox clients | | E2BSandboxClient | Adapter for E2B-compatible sandbox instances and snapshots | | InMemorySandboxClient | Deterministic sandbox client for tests |

TToolResult Shape

interface TToolResult {
  success: boolean;
  output: string;
  error?: string;
  exitCode?: number;
  startLine?: number; // Start line number of the edit in the original file (Edit tool only)
}

TToolResult is the inner result type used by built-in tools. It is serialized to JSON and placed inside the IToolResult.data field before being returned to the Robota execution loop.

Dependencies

| Dependency | Kind | Purpose | | ------------------------ | ---- | ------------------------------------------------------ | | @robota-sdk/agent-core | Peer | Abstract tool base class, tool interfaces, event types | | fast-glob | Prod | High-performance glob matching for the Glob tool | | zod | Prod | Schema validation for function tool parameters |

License

MIT