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:- MCP server configs — typed factories (
FilesystemToolServer,CodeRunnerToolServer) that produce the spawn config for a well-known MCP server. You register them withagent.register_mcp(). - Built-in capability library —
BuiltinToolLoaderloads pre-written capabilities for third-party APIs (GitHub, Jira, Slack, …) that you wire into your agent withagent.define_capability(). - HTTP helper —
HttpHelperis 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.
agent.define_capability().
Functional usage — combined example
MCP server configs
FilesystemToolServer
@modelcontextprotocol/server-filesystem. The server process runs locally with the given root as its sandbox.
FilesystemToolServerOptions
| Field | Type | Default | Purpose |
|---|---|---|---|
root | string | — | Required. Directory the MCP server is allowed to read/write. |
package_name? | string | @modelcontextprotocol/server-filesystem | Override to pin a version or fork. |
name? | string | filesystem | Registration label. |
Methods
config(): McpServerConfig— spawn config to pass toagent.register_mcp().as_registration(): Record<string, McpServerConfig>—{ [name]: config }for bulk registration.
CodeRunnerToolServer
allowed_commands and timeout_ms.
CodeRunnerToolServerOptions
| Field | Type | Default | Purpose |
|---|---|---|---|
root | string | — | Required. Working directory for executed commands. |
allowed_commands? | string[] | unrestricted | Allowlist of command names. |
timeout_ms? | number | unrestricted | Per-command wallclock timeout. |
package_name? | string | (ships default) | Override package. |
name? | string | code_runner | Registration label. |
Built-in capability library
BuiltinToolLoader / BUILTIN_DOMAINS
| Domain | Provides |
|---|---|
github | List / get / create PRs, diffs, reviews, merges. |
bitbucket | List / get / create PRs, diffs, comments, merges. |
jira | Get / create issues, add comments, transition status. |
zendesk | List / get / create / update tickets, add comments. |
slack | Send messages (text or threaded replies). |
shell | General-purpose command execution. |
datadog | Query metrics, list alerts. |
hubspot | Contacts and deals — list, get, create, update. |
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, aggregatingtools/loaded/errors.load_all()— load every domain.list_domain(domain)— return the list of tool names available in a domain without loading.domains— getter returningBUILTIN_DOMAINS.
BuiltinLoadResult
| Field | Type | Description |
|---|---|---|
tools | LocalToolDefinition[] | Loaded tool objects. Each has name, description, parameters, handler. |
loaded | string[] | Names that loaded successfully. |
errors | string[] | Per-tool error strings for anything that failed. |
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.
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.
