Skip to main content

Built-in tools

What it is

A small library of ready-to-use tools shipped with the SDK so you don’t have to write boilerplate for common needs. There are three independent pieces:
  1. MCP server configs — typed factories (FilesystemToolServer, CodeRunnerToolServer) that produce the spawn config for a well-known MCP server. You register them with agent.register_mcp().
  2. Built-in capability libraryBuiltinToolLoader loads pre-written capabilities for third-party APIs (GitHub, Jira, Slack, …) that you wire into your agent with agent.define_capability().
  3. HTTP helperHttpHelper is a tiny fetch wrapper with bearer-token auth, used by the built-in library and exported for your own tools.

When to use them

  • FilesystemToolServer — your agent needs to read or write files under a specific directory.
  • CodeRunnerToolServer — your agent needs to execute scripts or shell commands in a sandbox.
  • BuiltinToolLoader — you want working GitHub / Jira / Slack / etc. capabilities without writing them by hand.
  • HttpHelper — you’re writing your own third-party integration and want consistent auth and error handling.
If none of these fit your use case, write a capability directly with agent.define_capability().

Functional usage — combined example

MCP server configs

FilesystemToolServer

Scoped filesystem access via @modelcontextprotocol/server-filesystem. The server process runs locally with the given root as its sandbox.

FilesystemToolServerOptions

Methods

  • config(): McpServerConfig — spawn config to pass to agent.register_mcp().
  • as_registration(): Record<string, McpServerConfig>{ [name]: config } for bulk registration.

CodeRunnerToolServer

Sandboxed shell/code execution. Tighten the blast radius with allowed_commands and timeout_ms.

CodeRunnerToolServerOptions

Built-in capability library

BuiltinToolLoader / BUILTIN_DOMAINS

Each domain groups a set of pre-built capabilities for a third-party API. Credentials are read from environment variables at call time (documented on each tool). BUILTIN_DOMAINS is the exhaustive list as a runtime constant.

Methods

  • load_domain(domain) — load every tool in one domain.
  • load_domains(domains) — load multiple domains, aggregating tools / loaded / errors.
  • load_all() — load every domain.
  • list_domain(domain) — return the list of tool names available in a domain without loading.
  • domains — getter returning BUILTIN_DOMAINS.

BuiltinLoadResult

Each LocalToolDefinition can be registered with agent.define_capability():

HTTP helper

HttpHelper

Small fetch wrapper used by the built-in tools for bearer-token-authenticated REST calls. Exported for custom tools that follow the same pattern.
Methods: get, post, put, patch, request. Plus check_auth() — returns { configured: true | false, env_var? } so tools can bail early with a helpful message when the env var isn’t set.

See also