Integrations

Vercel AI SDK

Installation

Install the integration package and configure your API key.

bun add @quercle/ai-sdk
View repository

Available tools

All five Quercle endpoints are exposed as tools through this integration.

ToolEndpointDescription
quercleFetchFetchFetch a URL and return an AI-synthesized answer based on page content and your prompt.
quercleSearchSearchSearch the web and return an AI-synthesized answer from the retrieved results.
quercleRawFetchRaw FetchFetch a URL and return raw markdown or HTML.
quercleRawSearchRaw SearchRun web search and return raw results.
quercleExtractExtractFetch a URL and return chunks relevant to a query.

Endpoint examples

Use the same endpoint methods directly through this integration.

import { createQuercleTools } from "@quercle/ai-sdk";

const { quercleFetch } = createQuercleTools({ apiKey: "qk_your_api_key" });
const result = await quercleFetch.execute({ url: "https://example.com", prompt: "Summarize the main points" });
console.log(result);

Use in agents

Wire the integration into your agent orchestration loop.

import { quercleFetch, quercleSearch, quercleRawFetch, quercleRawSearch, quercleExtract } from "@quercle/ai-sdk";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";

const { text } = await generateText({
  model: openai("gpt-4o"),
  tools: { quercleFetch, quercleSearch, quercleRawFetch, quercleRawSearch, quercleExtract },
  maxSteps: 5,
  prompt: "Research MCP security pitfalls and summarize mitigation techniques.",
});

console.log(text);