rtrvr.ai logo
rtrvr.ai
PricingBlogDashboard

Core Agent

Getting StartedWeb AgentSheets Workflows

Building Blocks

Recordings & GroundingTool CallingKnowledge Base (RAG)

Platform Access

API OverviewAgent APIScrape APIBrowser as API/MCP

Automation

ShortcutsTriggers & WebhooksSchedules

Account & Security

Cookie SyncPermissions & Privacy
DocsTool Calling

Tool Calling

Extend your agent with MCP servers, custom JavaScript functions, and AI-generated integrations — shared across extension, cloud, and API.

3 min read

rtrvr.ai agents aren't limited to browsing. They can call external APIs, query databases, and run custom logic using the Model Context Protocol (MCP) or secure JavaScript tools. Tools are a shared primitive — create them once, use them across the extension, cloud, and API.

Direct Tool Calls

When you know exactly which tool to use, bypass the AI planner with the @toolName syntax. This is highly efficient for repetitive tasks and gives you direct control.

text
@act(action="click submit")              → Direct browser action
@extractToSheets(prompt="get emails")     → Fast extraction across open tabs
@hubspot_lookup(email="user@example.com") → Call a custom/MCP tool directly

MCP Servers

Connect to any Model Context Protocol server by pasting its URL. Once connected, all MCP tools become available in your chat with @toolname syntax. rtrvr.ai supports SSE (Server-Sent Events), HTTP Streamable, and OAuth-protected servers.

  • Open the Tools section in extension settings
  • Paste the MCP server URL (e.g., your company's internal MCP, or a public one)
  • Authenticate if required (OAuth flow handled in-browser)
  • All server tools appear instantly — use them with @toolname in chat
OAuth-protected servers require periodic reauthentication. You can manage sessions in the extension settings or via the cloud dashboard.

AI Tool Generator

Don't have an MCP server? The Tool Generator sub-agent can create custom integrations automatically. Just describe what you need in plain English — or better yet, point the agent at an API documentation page and let it build the tool for you.

text
"Find my HubSpot API keys and create a tool to load contacts"

"Use this onscreen API docs to create a tool that searches our internal database"

"Create a tool that calls the OpenWeatherMap API with a city name and returns the forecast"
Tools created in the Chrome Extension can be saved and reused in the Cloud environment. They travel with shared workflows.

Custom JavaScript Tools

Write your own tools in JavaScript or let the AI build them. Tools run securely in your browser via a sandboxed iframe. You can store API keys as default parameters — they remain local to your machine and are never sent to rtrvr.ai servers.

How Parameters Work

When you define parameters for a custom function, they become available as JavaScript variables in your code. The system automatically converts each parameter into a const declaration before running your code.

javascript
// Parameters defined: firstName (string), lastName (string), apiKey (string, default)
// Your code — parameters are pre-declared as const variables:

const res = await fetch(`https://api.example.com/users?name=${firstName}+${lastName}`, {
  headers: { "Authorization": `Bearer ${apiKey}` }
});
const data = await res.json();
return data.results;
  • Define parameters with names, types, and optional defaults
  • Reference parameters directly as variables (firstName, not params.firstName)
  • Parameters are injected as const declarations before your code runs
  • Return any JSON-serializable value — async/await is fully supported
  • console.log() output is captured and shown in results for debugging
API keys stored as default parameters = local only, never sent to servers. This is the recommended pattern for authenticated tool calls.

Code Examples

javascript
// Simple greeting
return `Hello ${firstName} ${lastName}!`;

// Math
return price * quantity * (1 + taxRate);

// API call
const r = await fetch(url);
return await r.json();

// Transform
return items.map(i => i.name).join(", ");

Parameter names must be valid JavaScript identifiers (letters, numbers, underscores — no spaces).

Sheets Tool Mapping

In Sheets Workflows, the agent can map tool calls to run for every row — intelligently pulling arguments from specific columns. Just include instructions in your prompt:

text
"For each row, use the loadContact tool to upload the email in Column A and name in Column B to HubSpot"
Column A (Email)Column B (Name)Column C (Result)
user@example.comJane Doe✅ Contact created (ID: 12345)
admin@test.orgJohn Smith✅ Contact created (ID: 12346)

Platform Availability

CapabilityExtensionCloudAPI
@toolname direct calls✅——
MCP server connections✅✅✅
AI Tool Generator✅✅—
Custom JavaScript tools✅✅—
Sheets tool mapping✅✅✅
Tools in replayed workflows✅✅✅
Previous
Recordings & Grounding
Next
Knowledge Base (RAG)

On this page

Direct Tool CallsMCP ServersAI Tool GeneratorCustom JavaScript ToolsSheets Tool MappingPlatform Availability

Ready to automate?

Join teams using rtrvr.ai to build playful, powerful web automation workflows.