Skip to content

Built-in Tools

Astromesh ships with 18 built-in tools that cover common agent needs. They are implemented as Python classes extending BuiltinTool and registered via type: builtin in agent YAML. No external dependencies are needed for most tools.

ToolCategoryDescription
datetime_nowUtilitiesCurrent date/time with timezone
json_transformUtilitiesTransform JSON via Jinja2 template
cache_storeUtilitiesKey-value cache between tool calls
http_requestHTTPHTTP requests (GET/POST/PUT/DELETE/PATCH)
graphql_queryHTTPGraphQL queries
web_searchWebSearch via Tavily API
web_scrapeWebExtract text from URLs
wikipediaWebWikipedia article summaries
read_fileFilesRead local files
write_fileFilesWrite local files
sql_queryDatabaseSQL queries (SQLite, read-only default)
send_webhookCommunicationPOST to webhook URLs
send_slackCommunicationSlack messages via webhook
send_emailCommunicationEmail via SMTP
send_messageCommunicationReach a person on a channel mid-run (needs Nexus)
text_summarizeAISummarize text via agent’s model
rag_queryRAGQuery RAG pipeline
rag_ingestRAGIngest into RAG pipeline

Register built-in tools in your agent YAML under spec.tools with type: builtin:

spec:
tools:
- name: web_search
type: builtin
config:
provider: tavily
api_key: ${TAVILY_API_KEY}
- name: http_request
type: builtin
config:
allow_localhost: false
timeout_seconds: 30
- name: sql_query
type: builtin
config:
connection_string: "sqlite:///data/app.db"
read_only: true

Each tool defines its own config options. Secrets can be passed via config fields with ${ENV_VAR} substitution or through context.secrets.

List all available built-in tools and their schemas via the REST API:

GET /v1/tools/builtin

The response includes each tool’s name, description, and parameter schema in OpenAI function calling format.

Returns the current date and time.

ParameterTypeRequiredDescription
timezonestringNoIANA timezone name (e.g. America/New_York). Falls back to UTC on invalid timezone

Returns: { datetime, timezone, unix_timestamp }

Transforms a JSON value using a Jinja2 template.

ParameterTypeRequiredDescription
dataanyYesInput data accessible as {{ data }} in the template
templatestringYesJinja2 template that outputs JSON. Use {{ data.field }} to access nested values

Returns: Parsed JSON from the rendered template output.

The template is written by the model, so it renders in Jinja2’s ImmutableSandboxedEnvironment: an access the sandbox forbids (e.g. {{ lipsum.__globals__ }}) comes back as the tool’s error instead of running code in the runtime. Available since astromesh v0.56.2.

Key-value cache shared across tool calls within a session. Uses the ToolContext.cache dict.

ParameterTypeRequiredDescription
actionstringYesOne of get, set, or delete
keystringYesCache key
valueanyNoValue to store (required for set)

Makes HTTP requests to external services.

ParameterTypeRequiredDescription
methodstringYesHTTP method: GET, POST, PUT, DELETE, or PATCH
urlstringYesTarget URL
headersobjectNoRequest headers
bodyanyNoRequest body (JSON-serialized)

Config options:

OptionTypeDefaultDescription
allow_localhostboolfalseDisables the internal-destination check entirely — not only localhost, but every private or cluster-internal host. Operator config; the model cannot set it
timeout_secondsint30Request timeout
max_response_bytesint5242880Maximum response size (5 MB)

Executes GraphQL queries against a remote endpoint.

ParameterTypeRequiredDescription
endpointstringYesGraphQL endpoint URL
querystringYesGraphQL query or mutation
variablesobjectNoQuery variables
headersobjectNoRequest headers

Config options:

OptionTypeDefaultDescription
timeout_secondsint30Request timeout

Searches the web using a search provider.

ParameterTypeRequiredDescription
querystringYesSearch query
max_resultsintNoMaximum number of results to return

Config options:

OptionTypeDefaultDescription
providerstringtavilySearch provider
api_keystring—API key (or set SEARCH_API_KEY secret)

Returns: Array of search results with title, URL, and snippet.

Extracts text content from a URL by stripping HTML tags, scripts, and styles.

ParameterTypeRequiredDescription
urlstringYesURL to scrape
max_lengthintNoMaximum character length of extracted text. Default: 10000

Follows redirects automatically.

Fetches Wikipedia article summaries via the Wikipedia REST API.

ParameterTypeRequiredDescription
topicstringYesArticle topic to look up
languagestringNoWikipedia language code. Default: en

language builds the host ({language}.wikipedia.org), so it must look like a language code (en, pt, zh-min-nan); anything else is rejected, and topic is URL-encoded into the path. The model cannot point the tool at another host. Available since astromesh v0.56.2.

Reads a file from the local filesystem.

ParameterTypeRequiredDescription
pathstringYesFile path to read
encodingstringNoFile encoding. Default: utf-8

Config options:

OptionTypeDescription
allowed_pathslistList of directory prefixes the tool is allowed to read from. Access outside these paths is blocked

Writes content to a file on the local filesystem. Creates parent directories automatically if they do not exist.

ParameterTypeRequiredDescription
pathstringYesFile path to write
contentstringYesContent to write
encodingstringNoFile encoding. Default: utf-8

Config options:

OptionTypeDescription
allowed_pathslistList of directory prefixes the tool is allowed to write to. Access outside these paths is blocked

Executes SQL queries against a database. Currently supports SQLite.

ParameterTypeRequiredDescription
querystringYesSQL query to execute
paramslistNoParameterized query values

Config options:

OptionTypeDefaultDescription
connection_stringstring—Database connection string (required). e.g. sqlite:///data/app.db
read_onlybooltrueBlock write operations. When enabled, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER, and TRUNCATE statements are rejected
max_rowsint1000Maximum rows returned per query

Sends a POST request with a JSON body to a webhook URL.

ParameterTypeRequiredDescription
urlstringYesWebhook URL
payloadanyYesJSON payload
headersobjectNoAdditional request headers

Sends a message to Slack via an incoming webhook.

ParameterTypeRequiredDescription
messagestringYesMessage text
channelstringNoChannel override

Config options:

OptionTypeDescription
webhook_urlstringSlack incoming webhook URL (or set SLACK_WEBHOOK_URL secret)

Sends an email via SMTP. Uses asyncio.to_thread() internally to avoid blocking the event loop.

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringYesEmail subject
bodystringYesEmail body

Config options:

OptionTypeDefaultDescription
smtp_hoststring—SMTP server hostname
smtp_portint587SMTP server port
smtp_userstring—SMTP username
smtp_passwordstring—SMTP password
from_addressstring—Sender email address

Reaches a person through a communications channel — WhatsApp, today — while the run is in progress. Every other tool here answers whoever wrote first; this one lets an agent start the conversation, or come back to someone hours later.

Added in v0.40.0.

ParameterTypeRequiredDescription
channelstringYesChannel to send through, e.g. whatsapp
recipientstringYesWho to reach on that channel, e.g. a phone number in E.164
textstringYesThe message body
conversation_refstringNoId of an existing conversation. Pinning the send to one keeps it inside WhatsApp’s 24-hour window; without it the send is a cold contact and the provider may require an approved template

Config options:

OptionTypeDefaultDescription
nexus_urlstring$ASTROMESH_NEXUS_URLBase URL of the Nexus that owns the outbox

Delivery is asynchronous. A successful call means the message was queued in the Herald/Nexus outbox — pending is the normal answer, not a problem.

Summarizes text using the agent’s configured model. If the input text is shorter than 500 characters, it is returned as-is with was_summarized: false.

ParameterTypeRequiredDescription
textstringYesText to summarize
max_lengthintNoTarget summary length

Queries the RAG pipeline attached to the agent’s context. Requires a RAG pipeline to be configured.

ParameterTypeRequiredDescription
querystringYesSearch query
top_kintNoNumber of results to return

Ingests a document into the RAG pipeline attached to the agent’s context. Requires a RAG pipeline to be configured.

ParameterTypeRequiredDescription
documentstringYesDocument content to ingest
metadataobjectNoDocument metadata
  • Network tools cannot reach internal destinations (since astromesh v0.56.2). http_request, graphql_query, web_scrape and send_webhook accept only http/https URLs to public hosts. They reject internal names without resolving them (localhost, names without a dot, *.local, *.internal, *.svc, *.cluster.local), IP literals that are not global, and names that resolve to a non-global IP (private, loopback, link-local, reserved; a NAT64 64:ff9b::/96 address is judged by its embedded IPv4). The check runs on every request, redirect hops included (web_scrape follows redirects). A blocked destination is returned as the tool’s error. allow_localhost: true on http_request is the only way out, and it is operator config.
  • The check resolves the name and httpx resolves it again to connect, so a DNS answer that changes in between (rebinding) is not caught by these four tools. Pair them with a pod NetworkPolicy.
  • json_transform renders in a Jinja2 sandbox; wikipedia cannot change host through language (both since v0.56.2).
  • read_file / write_file support allowed_paths restrictions to limit filesystem access to specific directories.
  • sql_query defaults to read_only: true, blocking all write and DDL statements.
  • send_email uses asyncio.to_thread() for non-blocking SMTP operations.
  • Secrets can be injected via config fields with ${ENV_VAR} substitution or through context.secrets at runtime.

Extend BuiltinTool to create your own tools:

from astromesh.tools.base import BuiltinTool, ToolContext, ToolResult
class MyTool(BuiltinTool):
name = "my_tool"
description = "Does something useful"
parameters = {
"type": "object",
"properties": {"input": {"type": "string"}},
"required": ["input"],
}
async def execute(self, arguments: dict, context: ToolContext) -> ToolResult:
return ToolResult(success=True, data={"output": arguments["input"]})

Custom tools follow the same async def execute() contract as all built-in tools. Define name, description, and parameters (JSON Schema) as class attributes, then implement execute() to return a ToolResult.