@agentskit/tools — Interfaces
API interfaces for @agentskit/tools.
#Interface: DefineZodToolConfig<TSchema>
Defined in: zod.ts:21
#Type Parameters
#TSchema
TSchema extends ZodLike
#Properties
#category?
optionalcategory?:string
Defined in: zod.ts:39
#description?
optionaldescription?:string
Defined in: zod.ts:23
#dispose?
optionaldispose?: () =>MaybePromise<void>
Defined in: zod.ts:37
#Returns
MaybePromise<void>
#execute?
optionalexecute?: (args,context) =>unknown
Defined in: zod.ts:32
#Parameters
args
InferZodOutput<TSchema>
context
ToolExecutionContext
#Returns
unknown
#init?
optionalinit?: () =>MaybePromise<void>
Defined in: zod.ts:36
#Returns
MaybePromise<void>
#name
name:
string
Defined in: zod.ts:22
#requiresConfirmation?
optionalrequiresConfirmation?:boolean
Defined in: zod.ts:31
#schema
schema:
TSchema
Defined in: zod.ts:24
#tags?
optionaltags?:string[]
Defined in: zod.ts:38
#toJsonSchema?
optionaltoJsonSchema?: (schema) =>JSONSchema7
Defined in: zod.ts:30
Convert the Zod schema to JSON Schema.
Users must supply this themselves (e.g. via zod-to-json-schema),
keeping the zod dependency entirely optional.
#Parameters
schema
TSchema
#Returns
JSONSchema7
#Interface: EgressPolicy
Defined in: safe-fetch.ts:8
Default-deny egress policy (ADR-0010). All outbound HTTP from tools should pass through safeFetch / checkEgress so a model-supplied or redirected URL cannot reach internal infrastructure (SSRF).
#Properties
#allowedHosts?
optionalallowedHosts?:string[]
Defined in: safe-fetch.ts:19
Literal hostname allowlist. If set, every request (and redirect hop) must
match exactly — overrides allowPrivateHosts. Wildcards unsupported by design.
#allowPrivateHosts?
optionalallowPrivateHosts?:boolean
Defined in: safe-fetch.ts:14
Allow requests to private / loopback / link-local addresses. Off by default so an agent can't reach AWS IMDS (169.254.169.254), the loopback interface, or RFC1918 services. Enable only for vetted internal targets.
#maxRedirects?
optionalmaxRedirects?:number
Defined in: safe-fetch.ts:21
Max redirects to follow; each hop is re-gated. Default 3.
#Interface: FetchUrlConfig
Defined in: fetch-url.ts:4
#Properties
#allowedHosts?
optionalallowedHosts?:string[]
Defined in: fetch-url.ts:28
Hostname allowlist. If set, every request (and every redirect hop)
must match a literal hostname in this list — overrides
allowPrivateHosts. Wildcards are not supported by design.
#allowPrivateHosts?
optionalallowPrivateHosts?:boolean
Defined in: fetch-url.ts:17
Allow requests to private/loopback/link-local addresses. Off by default so an agent can't reach AWS IMDS (169.254.169.254), the loopback interface, or internal RFC1918 services. Set true only when the tool runs against a vetted internal target.
#maxBytes?
optionalmaxBytes?:number
Defined in: fetch-url.ts:6
Maximum bytes to read from the response body. Default: 200 KB.
#maxRedirects?
optionalmaxRedirects?:number
Defined in: fetch-url.ts:22
Max redirects to follow. Each hop's resolved host is re-checked
against allowPrivateHosts to block redirect-based SSRF. Default 3.
#timeoutMs?
optionaltimeoutMs?:number
Defined in: fetch-url.ts:8
Request timeout in ms. Default: 15000.
#userAgent?
optionaluserAgent?:string
Defined in: fetch-url.ts:10
Header value for User-Agent. Default: AgentsKit/1.0.
#Interface: FilesystemConfig
Defined in: filesystem.ts:5
#Properties
#basePath
basePath:
string
Defined in: filesystem.ts:6
#denySymlinks?
optionaldenySymlinks?:boolean
Defined in: filesystem.ts:13
When true, refuse to operate on symlinks at all (read, write, list). Default true — symlinks inside basePath can target outside the jail and would otherwise leak access. Set false only if you trust the contents of basePath.
#Interface: ShellConfig
Defined in: shell.ts:7
#Properties
#allowAny?
optionalallowAny?:boolean
Defined in: shell.ts:22
Opt out of the allowlist requirement. When true, any executable is permitted — use only for trusted, sandbox-wrapped contexts. Off by default so a misconfigured agent cannot run arbitrary binaries.
#allowed?
optionalallowed?:string[]
Defined in: shell.ts:16
Allowlist of permitted executables. Required by default —
leave unset only when explicitly opting into the open mode via
allowAny:true. Each entry is matched against the command's
first token (the executable name).
#cwd?
optionalcwd?:string
Defined in: shell.ts:26
Working directory passed to the child process.
#env?
optionalenv?:ProcessEnv
Defined in: shell.ts:32
Environment for the child. Defaults to an empty object so secrets in the parent process environment do not leak into the executed command unless explicitly forwarded.
#maxOutput?
optionalmaxOutput?:number
Defined in: shell.ts:24
Cap on combined stdout/stderr per invocation. Default 1 MB.
#timeout?
optionaltimeout?:number
Defined in: shell.ts:9
Per-command timeout in ms. Default 30s.
#Interface: SlackToolConfig
Defined in: slack.ts:5
#Properties
#fetch?
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: slack.ts:8
Override fetch (mainly for tests). Defaults to the global fetch.
#Call Signature
(
input,init?):Promise<Response>
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
#Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | URL | Request
init?
RequestInit
Returns
Promise<Response>
#signal?
optionalsignal?:AbortSignal
Defined in: slack.ts:10
#timeoutMs?
optionaltimeoutMs?:number
Defined in: slack.ts:9
#webhookUrl
webhookUrl:
string
Defined in: slack.ts:6
#Interface: SqliteQueryConfig
Defined in: sqlite-query.ts:4
#Properties
#maxRows?
optionalmaxRows?:number
Defined in: sqlite-query.ts:9
Max rows returned. Defaults to 100.
#path
path:
string
Defined in: sqlite-query.ts:5
#readOnly?
optionalreadOnly?:true
Defined in: sqlite-query.ts:7
Reserved for v2; only true is accepted today.
#Interface: WebSearchConfig
Defined in: web-search.ts:13
#Properties
#apiKey?
optionalapiKey?:string
Defined in: web-search.ts:20
#maxResponseBytes?
optionalmaxResponseBytes?:number
Defined in: web-search.ts:25
Maximum provider response body size. Defaults to 2 MiB.
#maxResults?
optionalmaxResults?:number
Defined in: web-search.ts:21
#provider?
optionalprovider?:WebSearchProvider
Defined in: web-search.ts:19
Which backend to use. 'auto' (default) picks the best available:
Serper if SERPER_API_KEY is set, Tavily if TAVILY_API_KEY is set,
otherwise falls back to an unauthenticated DuckDuckGo HTML scrape.
#search?
optionalsearch?: (query) =>Promise<WebSearchResult[]>
Defined in: web-search.ts:29
Custom search function — overrides every other path.
#Parameters
query
string
#Returns
Promise<WebSearchResult[]>
#signal?
optionalsignal?:AbortSignal
Defined in: web-search.ts:27
Caller cancellation signal.
#timeoutMs?
optionaltimeoutMs?:number
Defined in: web-search.ts:23
Overall deadline for provider and custom-search work. Defaults to 15s.
#Interface: WebSearchResult
Defined in: web-search.ts:5
#Properties
#snippet
snippet:
string
Defined in: web-search.ts:8
#title
title:
string
Defined in: web-search.ts:6
#url
url:
string
Defined in: web-search.ts:7