Documentation

Tools

Seclai provides built-in tools that AI agents can use during prompt steps to inspect content and search knowledge bases. When enabled, these tools are injected as function-calling definitions into the model's prompt, allowing the model to call them during generation.

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

Tool Groups

Tools are organized into two groups:

  • Seclai Content Tools — Tools for loading, searching, and analyzing source documents
  • Seclai Knowledge Base — Semantic search across your knowledge bases

Seclai 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

Seclai Knowledge Base

The 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.

Usage Notes

  • Tools are available for both simple format and JSON template format prompt call steps.
  • 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.

Next Steps