Skip to content
Get started
Integrations

Tabstack for LlamaIndex.TS

Give your LlamaIndex.TS agents reliable web access with @tabstack/llamaindex: schema-enforced extraction, research, generation, and browser automation as native LlamaIndex tools.

@tabstack/llamaindex gives your LlamaIndex.TS agents reliable web access: schema-enforced extraction, multi-source research, AI transformation, and browser automation, all as native LlamaIndex tools backed by the official @tabstack/sdk.

LlamaIndex’s tool() is Zod-native, so each tool’s schema passes straight through as parameters and LlamaIndex derives the advertised JSON Schema itself.

Terminal window
npm install @tabstack/llamaindex llamaindex zod

llamaindex (v0.12 or later) and zod (v3 or v4) are peer dependencies, so your app’s single instance of each is shared. The quickstart below also needs the agent workflow and model packages, for example npm install @llamaindex/workflow @llamaindex/openai.

Create and Setup Your API Key

Before you can start using Tabstack API, you’ll need to create an API key and set it up in your environment.

1. Create Your API Key

  1. Visit the Tabstack Console
  2. Sign in to your account (or create one if you haven’t already)
  3. Navigate to the API Keys section and click the “Manage API Keys”
  4. Once you are on the API Keys page, Click “Create New API Key”
  5. Give your key a descriptive name (e.g., “Development”, “Production”) and click the “Create API Key”
  6. Copy the generated API key and store it securely

2. Set Up Environment Variable

For security and convenience, we recommend storing your API key as an environment variable rather than hardcoding it in your scripts.

macOS/Linux
Terminal window
# Add to your shell profile (~/.bashrc, ~/.zshrc, or ~/.bash_profile)
export TABSTACK_API_KEY="your_api_key_here"
# Or set it temporarily for the current session
export TABSTACK_API_KEY="your_api_key_here"
# Reload your shell or run:
source ~/.bashrc # or ~/.zshrc
Windows (Command Prompt)
# Set temporarily for current session
set TABSTACK_API_KEY=your_api_key_here
# Set permanently (requires restart)
setx TABSTACK_API_KEY "your_api_key_here"
Windows (PowerShell)
# Set temporarily for current session
$env:TABSTACK_API_KEY = "your_api_key_here"
# Set permanently for current user
[Environment]::SetEnvironmentVariable("TABSTACK_API_KEY", "your_api_key_here", "User")

3. Verify Your Setup

Test that your environment variable is set correctly:

macOS/Linux/Windows (Git Bash):

Terminal window
echo $TABSTACK_API_KEY

Windows (Command Prompt):

Terminal window
echo %TABSTACK_API_KEY%

Windows (PowerShell):

Terminal window
echo $env:TABSTACK_API_KEY

You should see your API key printed in the terminal.

import { openai } from "@llamaindex/openai";
import { agent } from "@llamaindex/workflow";
import { tabstackTools } from "@tabstack/llamaindex";
import { Settings } from "llamaindex";
Settings.llm = openai({ model: "gpt-4o" });
const researcher = agent({
tools: tabstackTools,
systemPrompt:
"You are a research assistant with web intelligence tools. " +
"Use research_question for open questions that need multiple sources, " +
"extract_page_content to read a specific URL as markdown, and the extract tools " +
"to pull structured fields from a page. Always cite your sources.",
});
const result = await researcher.run("What are Vercel's current pricing plans? Cite your sources.");
console.log(result.data);

tabstackTools is an array of ready-to-use tools that resolves TABSTACK_API_KEY lazily on first call, so importing the package never requires a key to be set.

ToolExportWhat it does
extract_structured_dataextractStructuredDataToolPull specific fields from a URL into a JSON shape you define.
extract_page_contentextractPageContentToolFetch a page as clean markdown.
research_questionresearchQuestionToolSynthesize a cited answer across multiple pages.
generate_structured_datagenerateStructuredDataToolFetch a page, then AI-transform it into derived or reshaped JSON.
automate_browser_taskautomateBrowserTaskToolRun a multi-step, natural-language browser task.

Import individual tools for a subset, or use the tabstackTools array for all of them:

import { agent } from "@llamaindex/workflow";
import { extractPageContentTool, researchQuestionTool } from "@tabstack/llamaindex";
const researcher = agent({ tools: [researchQuestionTool, extractPageContentTool] });

The model fills these in, but it helps to know the shapes:

  • extract_structured_data: url, json_schema_json (a JSON-encoded JSON Schema string).
  • extract_page_content: url.
  • research_question: query.
  • generate_structured_data: url, instructions, json_schema_json.
  • automate_browser_task: task, plus optional url, guardrails, data, country, max_iterations, max_validation_attempts.

See Schema design for writing json_schema_json that extracts reliably.

The model can pass these for finer control; they are sent to Tabstack only when present.

  • extract_structured_data, extract_page_content, generate_structured_data:
    • effort: "min", "standard", or "max". Use "max" for JS-heavy pages. See Effort levels.
    • nocache: bypass the cache.
    • country: ISO 3166-1 alpha-2 code for geotargeting.
  • research_question: mode ("fast" or "balanced"), nocache.
  • automate_browser_task: guardrails (constraints on what the agent may do), data (context for form filling), country, max_iterations, max_validation_attempts.

For a custom API key or base URL, or to reuse one client, build the tools explicitly:

import { createTabstackLlamaindexTools } from "@tabstack/llamaindex";
const tools = createTabstackLlamaindexTools({ apiKey: process.env.MY_KEY });
// or pass an SDK client you already have: createTabstackLlamaindexTools({ client })

When a tool call fails it throws TabstackToolError (a normalized message plus an HTTP status for API errors). LlamaIndex surfaces this in the tool result.

Inputs are re-validated against the tool’s schema inside execute before the SDK call, because LlamaIndex only logs a warning on a validation failure and still runs the tool. Malformed model output therefore fails fast as a TabstackToolError rather than reaching the API.