Tools

Tools

Seclai provides built-in tools that AI agents can call during Prompt Call steps. When enabled, tool definitions are injected into the model's prompt as function-calling schemas, allowing the model to call them during generation, inspect the results, and call more tools before producing its final response.

All tools — including web search and web fetch — are provided by the Seclai platform, not by the model vendor. This means every model that supports function calling gets access to web search, knowledge base retrieval, content inspection, and memory tools, regardless of whether the vendor offers those capabilities natively.

Tools are enabled per prompt step in the agent editor. Select the tool groups you want available in the Tools dropdown when configuring a prompt call step.

Tools vs. Explicit Steps

Seclai offers two ways to perform the same action — as an explicit agent step in the pipeline, or as a tool the model can call inside a prompt call step. Understanding the tradeoff helps you build agents that are both reliable and flexible.

Explicit Steps (Deterministic)

Explicit steps run as fixed stages in the agent pipeline. They execute unconditionally (or conditionally via a Gate) with parameters you define at design time.

Example — Summarize a specific webpage every morning:

  1. Web Fetch → fetch https://example.com/daily-report
  2. Prompt Call → "Summarize this report in 3 bullet points"
  3. Send Email → deliver the summary

Every run fetches the same URL, processes it the same way, and delivers the result. The pipeline is predictable and easy to debug.

Pros:

  • Predictable — Each step runs in a fixed order with known inputs and outputs. Easy to trace and debug.
  • Cheaper — No extra tokens spent on tool-calling overhead. The model only processes the content it receives.
  • Works with any model — Doesn't require function-calling support.
  • Easier to test — You can inspect each step's output individually in the trace.

Cons:

  • Rigid — The pipeline always does the same thing regardless of context. You can't adapt the flow based on what the model finds.
  • Requires upfront knowledge — You must know the exact URLs, queries, knowledge bases, or memory keys at design time (or derive them from metadata templates).

Tool-Enabled Prompt Calls (Autonomous)

When you enable tool groups on a prompt call step, the model decides which tools to call, how many times, and in what order. The model can search, read results, refine its approach, and call more tools — all within a single step.

Example — Research agent that answers arbitrary questions:

  1. Prompt Call with seclai_web_tools + seclai_knowledge_base → "Answer the user's question using web search and our internal knowledge base. Cite your sources."
  2. Display Result → show the answer

The model autonomously decides whether to search the web, query the knowledge base, or both. It can issue multiple searches, follow up on partial results, and synthesize information from different sources.

Example — Smart content processor that adapts to document type:

  1. Prompt Call with seclai_content_tools + seclai_memory_banks → "Analyze the incoming document. Check memory for prior context on this topic. Produce a structured analysis and save key findings to memory."

The model inspects the document with content tools, checks memory for related entries, and writes new findings back — all driven by the content rather than a fixed script.

Pros:

  • Adaptive — The model reacts to what it finds. It can search for more detail, try different queries, or skip unnecessary lookups.
  • Handles open-ended tasks — Research, fact-checking, multi-source aggregation, and exploratory analysis work well because the model drives the process.
  • Fewer steps to maintain — A single tool-enabled prompt call can replace a chain of explicit steps.

Cons:

  • Less predictable — The model may call tools in unexpected ways or skip calls you expected it to make.
  • Higher token cost — Each tool call and its results consume tokens. Multiple rounds of tool calls can be expensive.
  • Requires function-calling models — Only models that support function calling can use tools. See Models.
  • Harder to debug — When the model makes a poor decision about which tools to call, it can be harder to diagnose than a failed explicit step.

Choosing an Approach

ScenarioRecommended approach
Fixed URL or query known at design timeExplicit Web Fetch or Web Search step
Open-ended research across multiple sourcesPrompt call with seclai_web_tools and/or seclai_knowledge_base
Always search the same knowledge baseExplicit Search Knowledge Base step
Let the model choose which knowledge base to searchPrompt call with seclai_knowledge_base (model discovers KBs via list_knowledge_bases)
Process a specific incoming documentExplicit Load Content step or Insight step
Explore documents dynamically based on prompt contextPrompt call with seclai_content_tools
Always write to a specific memory bank and keyExplicit Add Memory step
Let the model decide what to rememberPrompt call with seclai_memory_banks

You can also combine both approaches in a single agent. Use explicit steps for the deterministic parts of the pipeline (fetching a known URL, loading a specific document) and tool-enabled prompt calls for the parts that benefit from model autonomy (analysis, synthesis, follow-up research).


Tool Groups

Tools are organized into four groups. Enable one or more groups per prompt call step:

Group IDNameToolsPurpose
seclai_web_toolsSeclai Web Toolsseclai_web_search, seclai_web_fetchSearch the web and fetch page content
seclai_knowledge_baseSeclai Knowledge Basesearch_knowledge_base, list_knowledge_basesSemantic search across your knowledge bases
seclai_content_toolsSeclai Content Toolsload_content, peek_content, grep_content, get_content_stats, list_content_sourcesInspect and search within indexed source documents
seclai_memory_banksSeclai Memory Bankslist_memory_banks, add_chat_turn, add_memory, search_memory, load_chat_history, load_memoryRead and write persistent memory across agent runs

Web Tools

Web tools let the model search the web and fetch page content during generation. These tools are provided by the Seclai platform and available for every model that supports function calling — you don't need a vendor that offers built-in web browsing or internet access. The model decides which URLs to fetch and which queries to run based on the prompt context, making web tools ideal for research tasks where the set of pages isn't known in advance.

When to use web tools vs. web steps:

  • Web tools (seclai_web_tools in a prompt call) — The model autonomously decides what to search and fetch. It can issue multiple searches, follow links, and refine queries across tool-call rounds. Best for open-ended research, fact-checking, and multi-source aggregation.
  • Web Fetch / Web Search steps — Execute exactly one fetch or search with a fixed (or template-substituted) URL/query. Best for deterministic pipelines where you know the target URL or query ahead of time.

Search the web and return results with titles, descriptions, and content snippets.

ParameterTypeRequiredDescription
querystringYesThe search query
limitintegerNoMaximum number of results to return (1–20, default 5)

Each result includes a URL, title, description, and a content snippet from the page.

seclai_web_fetch

Fetch a web page and return its content in the specified format.

ParameterTypeRequiredDescription
urlstringYesThe URL of the web page to fetch. Must start with http:// or https://.
formatstringNoOutput format — markdown (default), rawHtml, or text.

Returns the page URL, title, content in the requested format, and content type.


Knowledge Base Tools

Knowledge base tools let the model search your knowledge bases using semantic similarity and discover which knowledge bases are available. How the tools are configured depends on the context:

Scenarios

Scenario 1: Knowledge base ID in the prompt

When the prompt or system prompt explicitly contains a knowledge base ID (e.g. hardcoded or injected via {{metadata.knowledge_base_id}}), the model receives search_knowledge_base and is expected to call it with the provided ID.

Scenario 2a: Knowledge base ID in agent run metadata

When the agent run metadata includes a knowledge_base_id field (but the prompt doesn't explicitly mention it), the search_knowledge_base tool is included with that ID as the default value for the knowledge_base_id parameter. The model can call search_knowledge_base without specifying the ID — the default is used automatically.

Scenario 2b: No knowledge base ID available

When no knowledge base ID is available in metadata or the prompt, both list_knowledge_bases and search_knowledge_base are included. The model is expected to first call list_knowledge_bases to discover available knowledge bases, then call search_knowledge_base with a valid ID from the list.

list_knowledge_bases

List all knowledge bases available in the current account. Returns the ID, name, and description of each knowledge base. The model uses this to discover which knowledge bases it can search.

This tool takes no parameters.

search_knowledge_base

Search a knowledge base using semantic similarity.

ParameterTypeRequiredDescription
knowledge_base_idstringDepends on scenarioThe unique identifier of the knowledge base to search. Required in scenarios 1 and 2b. Has a default value in scenario 2a.
querystringYesThe search query string
top_nintegerNoMaximum number of results to return (1–200, default 10)

Each result includes the source_connection_content_version_id, source name, content title, matched text, and similarity score — allowing the model to follow up with content tools for deeper inspection.


Content Tools

Content tools let the model inspect source documents connected to your account. Each content tool (except list_content_sources) requires a source_connection_content_version_id to identify the specific document to operate on.

Scenarios

Scenario 1: Content version ID in the prompt

When the prompt or system prompt explicitly contains a source_connection_content_version_id (e.g. hardcoded or injected via {{metadata.source_connection_content_version_id}}), the model receives the content tools and is expected to call them with the provided ID. list_content_sources is included for discovery of additional content.

Scenario 2a: Content version ID in agent run metadata

When the agent run metadata includes a source_connection_content_version_id field (e.g. from a content added or content updated trigger), the content tools that require this ID are included with it as the default value. The model can call load_content, peek_content, grep_content, or get_content_stats without specifying the ID — the default is used automatically. list_content_sources is excluded since the target content is already known.

Scenario 2b: No content version ID available

When no content version ID is available in metadata or the prompt, all content tools are included along with list_content_sources. The model is expected to first call list_content_sources to discover available content sources and their content items, then call the other content tools with a valid ID from the results.

list_content_sources

List the content sources available in the current account. Returns source connections with their recent content items, including the source_connection_content_version_id needed to inspect content with other tools.

ParameterTypeRequiredDescription
limitintegerNoMaximum number of source connections to return (1–20, default 5)

load_content

Load the full text content of a specific source document.

ParameterTypeRequiredDescription
source_connection_content_version_idstringYesThe unique identifier of the content version to load

peek_content

Read a character range from a source document. Useful for reading specific sections without loading the entire document.

ParameterTypeRequiredDescription
source_connection_content_version_idstringYesThe unique identifier of the content version
startintegerYesThe starting character position (0-based)
stopintegerYesThe ending character position (exclusive)

grep_content

Search within a source document for all occurrences of a text query. Returns matching lines with surrounding context.

ParameterTypeRequiredDescription
source_connection_content_version_idstringYesThe unique identifier of the content version
querystringYesThe text to search for (case-insensitive)

get_content_stats

Get statistics about a source document including total length, line count, word count, and content type.

ParameterTypeRequiredDescription
source_connection_content_version_idstringYesThe unique identifier of the content version

Memory Bank Tools

Memory bank tools let the model read and write persistent memory that survives across agent runs. This is useful for agents that need to remember user preferences, track conversation history, or accumulate knowledge over time. See Memory Banks for more on memory bank types.

Memory banks come in two types:

  • Conversation — Chat-style history partitioned by key and speaker (user / assistant).
  • General — Flat factual entries partitioned by key, with no speaker.

list_memory_banks

List all memory banks available in the current account. Returns the ID, name, description, type, and mode of each memory bank. The model uses this to discover which memory banks it can interact with.

This tool takes no parameters.

add_chat_turn

Record a turn in a conversation memory bank. Use add_memory for general banks.

ParameterTypeRequiredDescription
memory_bank_idstringYesThe unique identifier of the conversation memory bank
keystringYesThe partition key (typically the conversation/user ID)
contentstringYesThe turn's text content
speakerstringYesThe speaker — user or assistant

add_memory

Write a fact to a general memory bank, partitioned by key. Use add_chat_turn for conversation banks.

ParameterTypeRequiredDescription
memory_bank_idstringYesThe unique identifier of the general memory bank
keystringYesThe partition key (e.g. user ID, topic, category)
contentstringYesThe text content to store

search_memory

Search a memory bank using semantic similarity, scoped to a specific key. Works on both conversation and general banks.

ParameterTypeRequiredDescription
memory_bank_idstringYesThe unique identifier of the memory bank
querystringYesThe search query
keystringYesThe partition key to search within
top_nintegerNoMaximum number of results to return (1–50, default 10)

load_chat_history

Load chat turns from a conversation memory bank in chronological order. Use load_memory for general banks.

ParameterTypeRequiredDescription
memory_bank_idstringYesThe unique identifier of the conversation memory bank
keystringYesThe partition key (typically the conversation/user ID)
orderstringNoSort order — newest_first (default) or oldest_first
limitintegerNoMaximum number of entries to return (1–200, default 50)

load_memory

Load entries from a general memory bank in chronological order. Use load_chat_history for conversation banks.

ParameterTypeRequiredDescription
memory_bank_idstringYesThe unique identifier of the general memory bank
keystringYesThe partition key to load entries for
orderstringNoSort order — newest_first (default) or oldest_first
limitintegerNoMaximum number of entries to return (1–200, default 50)

Tools vs. Explicit Steps

Seclai offers two ways to perform the same action — as an explicit agent step in the pipeline, or as a tool the model can call inside a prompt call step. Understanding the tradeoff helps you build agents that are both reliable and flexible.

Explicit Steps (Deterministic)

Explicit steps run as fixed stages in the agent pipeline. They execute unconditionally (or conditionally via a Gate) with parameters you define at design time.

Example — Summarize a specific webpage every morning:

  1. Web Fetch → fetch https://example.com/daily-report
  2. Prompt Call → "Summarize this report in 3 bullet points"
  3. Send Email → deliver the summary

Every run fetches the same URL, processes it the same way, and delivers the result. The pipeline is predictable and easy to debug.

Pros:

  • Predictable — Each step runs in a fixed order with known inputs and outputs. Easy to trace and debug.
  • Cheaper — No extra tokens spent on tool-calling overhead. The model only processes the content it receives.
  • Works with any model — Doesn't require function-calling support.
  • Easier to test — You can inspect each step's output individually in the trace.

Cons:

  • Rigid — The pipeline always does the same thing regardless of context. You can't adapt the flow based on what the model finds.
  • Requires upfront knowledge — You must know the exact URLs, queries, knowledge bases, or memory keys at design time (or derive them from metadata templates).

Tool-Enabled Prompt Calls (Autonomous)

When you enable tool groups on a prompt call step, the model decides which tools to call, how many times, and in what order. The model can search, read results, refine its approach, and call more tools — all within a single step.

Example — Research agent that answers arbitrary questions:

  1. Prompt Call with seclai_web_tools + seclai_knowledge_base → "Answer the user's question using web search and our internal knowledge base. Cite your sources."
  2. Display Result → show the answer

The model autonomously decides whether to search the web, query the knowledge base, or both. It can issue multiple searches, follow up on partial results, and synthesize information from different sources.

Example — Smart content processor that adapts to document type:

  1. Prompt Call with seclai_content_tools + seclai_memory_banks → "Analyze the incoming document. Check memory for prior context on this topic. Produce a structured analysis and save key findings to memory."

The model inspects the document with content tools, checks memory for related entries, and writes new findings back — all driven by the content rather than a fixed script.

Pros:

  • Adaptive — The model reacts to what it finds. It can search for more detail, try different queries, or skip unnecessary lookups.
  • Handles open-ended tasks — Research, fact-checking, multi-source aggregation, and exploratory analysis work well because the model drives the process.
  • Fewer steps to maintain — A single tool-enabled prompt call can replace a chain of explicit steps.

Cons:

  • Less predictable — The model may call tools in unexpected ways or skip calls you expected it to make.
  • Higher token cost — Each tool call and its results consume tokens. Multiple rounds of tool calls can be expensive.
  • Requires function-calling models — Only models that support function calling can use tools. See Models.
  • Harder to debug — When the model makes a poor decision about which tools to call, it can be harder to diagnose than a failed explicit step.

Choosing an Approach

ScenarioRecommended approach
Fixed URL or query known at design timeExplicit Web Fetch or Web Search step
Open-ended research across multiple sourcesPrompt call with seclai_web_tools and/or seclai_knowledge_base
Always search the same knowledge baseExplicit Search Knowledge Base step
Let the model choose which knowledge base to searchPrompt call with seclai_knowledge_base (model discovers KBs via list_knowledge_bases)
Process a specific incoming documentExplicit Load Content step or Insight step
Explore documents dynamically based on prompt contextPrompt call with seclai_content_tools
Always write to a specific memory bank and keyExplicit Add Memory step
Let the model decide what to rememberPrompt call with seclai_memory_banks

Usage Notes

  • Tools are available for both simple format and JSON template format prompt call steps.
  • Multiple tool groups can be enabled on a single prompt call step.
  • The model decides when and how to call tools based on the prompt and available context.
  • Multiple tool-call rounds are supported — the model can call tools, receive results, and call more tools before producing its final response.
  • Tool results are included in the conversation context and count toward the model's token usage.
  • All tools are platform-provided — web search, knowledge base retrieval, and memory tools work with any function-calling model, regardless of vendor.
  • Not all models support function calling. Look for the tool-use badge in the Models catalog to find compatible models.

Next Steps