Tooling

Tools are the external capabilities available to BeeSystem agents. Every tool has a typed input contract, typed output contract, and defined error behavior.

Built-in tools

ToolDescription
web_searchSearch the web via configured search API
document_readerRead PDF, TXT, MD, HTML documents
structured_writerWrite structured output (JSON, YAML, Markdown)
api_connectorMake HTTP API calls with configured credentials
database_queryRun typed queries against configured databases
file_systemRead and write files in the agent workspace
shell_execExecute shell commands (requires explicit capability)

Custom tools with the SDK

tools/my-api.tstypescript
import { defineTool } from "@beesystem/sdk";

export const myApiTool = defineTool({
  name: "my_api",
  description: "Calls My API with the given query",
  input: {
    query: { type: "string", required: true },
    limit: { type: "number", default: 10 },
  },
  output: {
    results: { type: "array" },
    total: { type: "number" },
  },
  async execute({ query, limit }) {
    const response = await fetch(`https://api.example.com/search?q=${query}&limit=${limit}`);
    if (!response.ok) {
      throw new ToolError("API_UNAVAILABLE", `Status ${response.status}`);
    }
    return response.json();
  },
});

Tool configuration in agent spec

agent.yamlyaml
tools:
  - name: my_api
    type: custom
    module: ./tools/my-api.ts
    config:
      timeout: 10s
      retry: 2