{"_id":"@arenza/vercel-ai-sdk","_rev":"2-a75df1d838fe7f073420741c3cec1389","name":"@arenza/vercel-ai-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@arenza/vercel-ai-sdk","version":"0.1.0","keywords":["arenza","geo","generative-engine-optimization","ai-visibility","ai-search","llm-seo","brand-mention-tracking","vercel-ai-sdk","ai-sdk","vercel","tools","streamtext","generatetext","chatgpt","claude","gemini","perplexity","copilot","grok"],"author":{"url":"https://arenza.ai","name":"Arenza","email":"hello@arenza.ai"},"license":"MIT","_id":"@arenza/vercel-ai-sdk@0.1.0","maintainers":[{"name":"fooly_cooly","email":"naiqiao@hotmail.com"}],"homepage":"https://arenza.ai","bugs":{"url":"https://github.com/arenza-ai/arenza-vercel-ai-sdk/issues"},"dist":{"shasum":"05e737056d1ddedf7c3cc3a399e127e3da201253","tarball":"https://registry.npmjs.org/@arenza/vercel-ai-sdk/-/vercel-ai-sdk-0.1.0.tgz","fileCount":13,"integrity":"sha512-F/6ZqubW4lKrcZUP4C8j2HzvegYhsTQeF9ZVKVIKWW0kZXzPSY0cSKYiApCos2uF29wpjURTbEcFlBl3GE8W0g==","signatures":[{"sig":"MEUCICq5U3uBIB9i+HP1kSvAoPPg7xtegJL0KzNPYn5+V4NeAiEA7PrZzUXrJIgDak86KD6CdRI3JFGCfBIE6q/Aq00EDF4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36174},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"038a53ce75aee5d5bdb1c92b4831e256c372aa64","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"fooly_cooly","email":"naiqiao@hotmail.com"},"repository":{"url":"git+https://github.com/arenza-ai/arenza-vercel-ai-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Vercel AI SDK tools for Arenza — drop-in tools you can pass to streamText / generateText so any agent (ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok) can read AI visibility metrics, GEO opportunities, and brand mention data.","directories":{},"_nodeVersion":"20.19.2","dependencies":{"zod":"^3.23.0","@arenza/mcp-client":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"peerDependencies":{"ai":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vercel-ai-sdk_0.1.0_1777999113002_0.7856858098395796","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-05T16:38:32.925Z","modified":"2026-05-07T02:26:02.689Z","0.1.0":"2026-05-05T16:38:33.154Z"},"bugs":{"url":"https://github.com/arenza-ai/arenza-vercel-ai-sdk/issues"},"author":{"url":"https://arenza.ai","name":"Arenza","email":"hello@arenza.ai"},"license":"MIT","homepage":"https://arenza.ai","keywords":["arenza","geo","generative-engine-optimization","ai-visibility","ai-search","llm-seo","brand-mention-tracking","vercel-ai-sdk","ai-sdk","vercel","tools","streamtext","generatetext","chatgpt","claude","gemini","perplexity","copilot","grok"],"repository":{"url":"git+https://github.com/arenza-ai/arenza-vercel-ai-sdk.git","type":"git"},"description":"Vercel AI SDK tools for Arenza — drop-in tools you can pass to streamText / generateText so any agent (ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok) can read AI visibility metrics, GEO opportunities, and brand mention data.","maintainers":[{"email":"naiqiao@hotmail.com","name":"fooly_cooly"},{"email":"quexiaoyu1016@gmail.com","name":"xiaoyuque"}],"readme":"# arenza-vercel-ai-sdk\n\n> Vercel AI SDK tools for **Arenza** — drop-in tools you can pass to `streamText` / `generateText` so any agent (powered by ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok, or any other model the AI SDK supports) gains typed access to AI visibility metrics, GEO opportunities, and brand mention data.\n\n[Arenza](https://arenza.ai) is a Generative Engine Optimization (GEO) platform that measures how 6 leading AI assistants describe brands. This package wraps the [Arenza MCP server](https://mcp.arenza.ai) as a [Vercel AI SDK](https://ai-sdk.dev) `ToolSet` so your existing chat UI, agent loop, or background worker can answer \"how does ChatGPT describe my brand?\" without wiring custom routes.\n\n## Why an Arenza tool plugin (not just a fetch loop)\n\nAI SDK agents that need to answer \"how does ChatGPT describe my brand?\" or \"what should we fix this week to improve our AI search ranking?\" benefit from a tool with a tight Zod schema and a clear, GEO-vocabulary description. Hand-rolling fetch calls inside a `streamText` step loses the structured-tool affordance, breaks tool-call repair, and forces every developer to re-derive the same parameter shapes.\n\n## Install\n\n```bash\nnpm install @arenza/vercel-ai-sdk arenza-mcp-client ai\n# or\npnpm add @arenza/vercel-ai-sdk arenza-mcp-client ai\n```\n\n`ai` is a peer dependency (`>=4.0.0`). Install whichever version your app already uses.\n\n## Quick start (Next.js app router)\n\n```ts\n// app/api/chat/route.ts\nimport { streamText } from 'ai';\nimport { openai } from '@ai-sdk/openai';\nimport { ArenzaMCPClient } from '@arenza/mcp-client';\nimport { arenzaTools } from '@arenza/vercel-ai-sdk';\n\nconst client = new ArenzaMCPClient({ token: process.env.ARENZA_TOKEN! });\n\nexport async function POST(req: Request) {\n  const { messages } = await req.json();\n  const result = streamText({\n    model: openai('gpt-4o-mini'),\n    tools: arenzaTools(client),\n    messages,\n  });\n  return result.toUIMessageStreamResponse();\n}\n```\n\nThe agent will call `arenza_list_brands`, `arenza_get_brand_overview`, `arenza_list_opportunities`, etc. on its own as it needs the data.\n\n## Quick start (vanilla, single shot)\n\n```ts\nimport { generateText } from 'ai';\nimport { anthropic } from '@ai-sdk/anthropic';\nimport { ArenzaMCPClient } from '@arenza/mcp-client';\nimport { arenzaTools } from '@arenza/vercel-ai-sdk';\n\nconst client = new ArenzaMCPClient({ token: process.env.ARENZA_TOKEN! });\n\nconst { text, toolCalls } = await generateText({\n  model: anthropic('claude-sonnet-4-5'),\n  tools: arenzaTools(client),\n  prompt: 'Which of our brands has the worst share of voice on Perplexity, and what wrong claims are hurting it most?',\n  // optional: maxSteps: 5,  // let the agent take multiple tool calls\n});\n\nconsole.log(text);\nconsole.log(toolCalls);  // shows which Arenza tools the model picked\n```\n\n## Tools exposed\n\n`arenzaTools(client)` returns an AI SDK `ToolSet` with 6 read-only tools by default:\n\n| Tool name | What it does |\n|---|---|\n| `arenza_list_brands` | Enumerate brands in the tenant portfolio. |\n| `arenza_get_brand_overview` | Share-of-voice + wrong-claim count + per-LLM mentions for one brand. |\n| `arenza_list_prompts` | The buyer-perspective prompts being probed for a brand, with mention rate per LLM. |\n| `arenza_list_opportunities` | Open GEO opportunities (wrong_claim, missing_canonical_page, listicle_gap, discussion_seed) with severity. |\n| `arenza_suggest_competitors` | LLM-suggested competitors to add to tracking. |\n| `arenza_suggest_prompts` | LLM-generated buyer-perspective prompts (70%+ unbranded ratio enforced). |\n\nPass `{ includeWrite: true }` to also get 4 write tools:\n\n| Tool name | What it does |\n|---|---|\n| `arenza_add_competitor` | Add a competitor to a brand's tracking list. |\n| `arenza_dismiss_competitor` | Remove a competitor (e.g. wrong suggestion). |\n| `arenza_mark_opportunity_done` | Mark a GEO opportunity as completed. |\n| `arenza_generate_geo_article` | Draft a canonical-fact article anchored to a specific finding. |\n\nWrite tools are opt-in because chat agents can be aggressive about side effects — you usually want a human in the loop before mutating tracking config.\n\n## Schemas\n\nEach tool ships a Zod `inputSchema` that the AI SDK forwards to the model as JSON Schema. For example:\n\n```ts\n// arenza_list_opportunities inputSchema\nz.object({\n  brand_id: z.string(),\n  type: z.enum(['wrong_claim', 'missing_canonical_page', 'listicle_gap', 'discussion_seed']).optional(),\n})\n```\n\nThe descriptions are deliberately GEO-vocabulary-heavy (mentioning ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok by name; mentioning \"share of voice\", \"hallucinations\", \"AI visibility\") so when an agent's prompt mentions any of those terms the tool router has high signal.\n\n## Authentication\n\nPass an Arenza API token to the client:\n\n```ts\nconst client = new ArenzaMCPClient({ token: process.env.ARENZA_TOKEN! });\n```\n\nGet a token at [app.arenza.ai/settings/api](https://app.arenza.ai/settings/api). For multi-tenant deployments, swap to OAuth — the MCP server publishes its OAuth metadata at [`mcp.arenza.ai/.well-known/oauth-authorization-server`](https://mcp.arenza.ai/.well-known/oauth-authorization-server).\n\n## Pattern: GEO copilot inside your existing AI SDK chat\n\nIf you already have an AI SDK chat route, drop the read-only Arenza tools into the existing tool set — your agent now answers \"how am I doing on AI search?\" without you wiring custom UI:\n\n```ts\nconst result = streamText({\n  model,\n  tools: {\n    ...yourExistingTools,\n    ...arenzaTools(client),  // adds 6 GEO tools\n  },\n  messages,\n});\n```\n\n## Pattern: weekly GEO triage worker\n\n```ts\nimport { generateText } from 'ai';\nimport { anthropic } from '@ai-sdk/anthropic';\nimport { ArenzaMCPClient } from '@arenza/mcp-client';\nimport { arenzaTools } from '@arenza/vercel-ai-sdk';\n\nexport async function weeklyTriage() {\n  const client = new ArenzaMCPClient({ token: process.env.ARENZA_TOKEN! });\n  const { text } = await generateText({\n    model: anthropic('claude-sonnet-4-5'),\n    tools: arenzaTools(client, { includeWrite: true }),\n    system:\n      'You are a GEO marketing triage agent. Each Monday you review the Arenza portfolio. ' +\n      'For every brand: list overview, list critical-severity opportunities, draft canonical articles ' +\n      'for any wrong-claim opportunity that is older than 7 days, and produce a one-paragraph human summary.',\n    prompt: 'Run this week\\'s triage.',\n  });\n  await postToSlack(text);\n}\n```\n\nSchedule with [Vercel Cron](https://vercel.com/docs/cron-jobs) and you have an autonomous GEO operations loop.\n\n## Pattern: server-side scan inside a Server Action\n\n```ts\n'use server';\n\nimport { generateText } from 'ai';\nimport { openai } from '@ai-sdk/openai';\nimport { ArenzaMCPClient } from '@arenza/mcp-client';\nimport { arenzaTools } from '@arenza/vercel-ai-sdk';\n\nexport async function scanForUser(brandDomain: string) {\n  const client = new ArenzaMCPClient({ token: process.env.ARENZA_TOKEN! });\n  const { text } = await generateText({\n    model: openai('gpt-4o-mini'),\n    tools: arenzaTools(client),\n    prompt: `Scan ${brandDomain}, summarise the AI visibility findings (mentioning per-LLM mention rate across ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok), and list the top 3 GEO opportunities.`,\n  });\n  return text;\n}\n```\n\n## Related projects\n\n- [`@arenza/mcp-client`](https://github.com/arenza-ai/arenza-mcp-client-ts) — the typed TS client this wraps.\n- [`arenza-mcp-client-python`](https://github.com/arenza-ai/arenza-mcp-client-python) — Python equivalent.\n- [`@arenza/cli`](https://github.com/arenza-ai/arenza-cli) — `npx arenza scan brand.com` for terminal scans.\n- [`@arenza/langchain`](https://github.com/arenza-ai/arenza-langchain) — same six tools wrapped for LangChain / LangGraph.\n- [`@arenza/llamaindex`](https://github.com/arenza-ai/arenza-llamaindex) — same for LlamaIndex.\n- [`arenza-zapier-actions`](https://github.com/arenza-ai/arenza-zapier-actions) — Zapier integration manifest.\n- [awesome-geo](https://github.com/arenza-ai/awesome-geo) — curated list of GEO and AI-visibility resources.\n\n## Resources\n\n- Arenza homepage: https://arenza.ai\n- Long-form GEO guides: https://arenza.ai/guides\n- AI brand reference: https://arenza.ai/llms.txt + https://arenza.ai/llms-full.txt\n- MCP server: https://mcp.arenza.ai\n- OAuth spec: https://mcp.arenza.ai/.well-known/oauth-authorization-server\n- Vercel AI SDK docs: https://ai-sdk.dev\n\n## License\n\nMIT (c) 2026 Arenza\n","readmeFilename":"README.md"}