Skip to content

Built-in Tools

Astromesh ships with 17 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
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.

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_localhostboolfalseWhether to permit requests to localhost, 127.0.0.1, 0.0.0.0, and ::1
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_keystringAPI 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

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_stringstringDatabase 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_hoststringSMTP server hostname
smtp_portint587SMTP server port
smtp_userstringSMTP username
smtp_passwordstringSMTP password
from_addressstringSender email address

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
  • http_request blocks requests to localhost (127.0.0.1, 0.0.0.0, ::1) by default. Set allow_localhost: true in config to override.
  • 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.