GitDealFlow × Vercel AI SDK
Ship VC signal features inside your Next.js app, Server Components, Route Handlers, Server Actions.
POST https://signals.gitdealflow.com/api/a2aWhy ship this
The Vercel AI SDK is the default for AI features inside web apps. If you ship Next.js, the AI SDK is the path of least resistance from idea to production. generateText, streamText, and tool() compose with React Server Components, Route Handlers, Server Actions, and the AI Gateway out of the box.
Drop GitDealFlow in as a single tool() with a Zod-validated input schema and your portfolio dashboard becomes deal-flow-aware. The MCP integration via experimental_createMCPClient gives you the same five skills with zero argument typing, useful for prototypes, but for production-shaped apps, the explicit tool() path is more debuggable and friendlier to TypeScript inference.
What you can build
Server Component data fetch
Pull weekly top 20 inside a Server Component, render the table at request time. Cache with React's `cache()` helper or Next.js fetch cache; the dataset refreshes weekly so 6-hour TTL is safe.
Streaming chat UI
useChat hook + streamText + tool() = a deal-flow chat panel that streams tokens, calls GitDealFlow, and renders structured tool results inline via the Generative UI pattern.
AI Gateway with model routing
Route to OpenAI for fast queries and Anthropic for memo writing, same tool, no code change. The AI Gateway handles the model switch and the observability is unified.
Background workflows with WDK
Vercel Workflow DevKit (WDK) makes long-running deal-flow batches durable. 'Enrich 50 startups overnight' survives crashes, retries automatically, and emails the result when done.
Tool() in a Route Handler
// app/api/chat/route.ts (Next.js App Router)
// Models route through the Vercel AI Gateway via plain string IDs.
import { tool, streamText, convertToModelMessages, type UIMessage } from "ai";
import { z } from "zod";
export const runtime = "nodejs"; // tool fetch + LLM stream
const A2A = "https://signals.gitdealflow.com/api/a2a";
const gitdealflow = tool({
description:
"Live VC engineering signals, trending startups, sector watchlists, named-startup profiles, dataset summaries, methodology citation.",
inputSchema: z.object({
skill: z.enum([
"get_trending_startups",
"search_startups_by_sector",
"get_startup_signal",
"get_signals_summary",
"get_methodology",
]),
args: z.record(z.string(), z.any()).optional(),
}),
execute: async ({ skill, args }) => {
const res = await fetch(A2A, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "message/send",
params: { message: { role: "user", parts: [
{ kind: "data", data: { skill, args: args ?? {} } },
]}},
}),
});
return (await res.json()).result.artifacts[0].parts[0].data;
},
});
export async function POST(req: Request) {
const { messages }: { messages: UIMessage[] } = await req.json();
const result = streamText({
model: "openai/gpt-5.4",
tools: { gitdealflow },
messages: convertToModelMessages(messages),
});
return result.toUIMessageStreamResponse();
}Server Component with cached weekly fetch
// app/dashboard/trending/page.tsx
import { unstable_cache } from "next/cache";
const A2A = "https://signals.gitdealflow.com/api/a2a";
const fetchTrending = unstable_cache(
async () => {
const res = await fetch(A2A, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "message/send",
params: { message: { role: "user", parts: [
{ kind: "data", data: { skill: "get_trending_startups" } },
]}},
}),
});
return (await res.json()).result.artifacts[0].parts[0].data.startups;
},
["gitdealflow-trending"],
{ revalidate: 21600, tags: ["gitdealflow"] }, // 6h
);
export default async function TrendingPage() {
const startups = await fetchTrending();
return (
<main>
<h1>Trending this week</h1>
<ol>
{startups.map((s: { name: string; sector: string }) => (
<li key={s.name}>
<strong>{s.name}</strong>: {s.sector}
</li>
))}
</ol>
</main>
);
}Five prompts to try first
- ›Pull weekly top 20 inside a Server Component to seed a dashboard.
- ›Stream a chat reply that calls gitdealflow when the user asks about a startup.
- ›Trigger from a Server Action: 'add this org to my watchlist'.
- ›Schedule a weekly Vercel Cron route that emails the top 5 breakouts.
- ›Compose with the AI Gateway: route fast lookups to a small model, memos to a large one.
FAQ
Does this work with the AI Gateway and BYOK?+
Yes. The AI Gateway sits transparently between your Vercel AI SDK code and any provider you're routed to. The gitdealflow tool() definition is unchanged, you can swap models freely or BYOK without touching the integration.
Can I run the tool in Edge runtime?+
Yes, the A2A endpoint is just a fetch, edge-safe. The MCP path (experimental_createMCPClient with stdio transport) is Node-only because it spawns a subprocess. For Edge, stick with the explicit tool() definition.
How does this fit with the Workflow DevKit (WDK)?+
WDK gives you durable, retryable steps. Wrap the gitdealflow fetch as a step.run() so a long batch, 'enrich 50 startups, write to Postgres, email when done', survives crashes and retries 5xx automatically. The endpoint returns 200 with JSON-RPC error envelopes, so check `result` vs `error`, not HTTP status.
Gotchas
- tool() expects you to return JSON-serializable data; the .data field on artifacts is already a plain object, passing it through is safe.
- If you use Edge runtime, the fetch to A2A should be on regular Node runtime since you may want to hold connections longer. Set `export const runtime = 'nodejs'`.
- The Vercel AI SDK's streamText pipes tool calls + tool results into the data stream, render them with the Generative UI pattern, not as plain text.
References
- Vercel AI SDK
- AI SDK MCP integration
- Vercel AI Gateway
- Our AgentCard (A2A descriptor)
- MCP HTTP endpoint same five skills, Streamable HTTP, no auth.
- Methodology paper (SSRN)
- Companion: A2A wire-up for Vercel AI SDK copy/paste install snippets and the alternative-approach patterns.
Other frameworks
When the free signal isn’t enough
The A2A and MCP endpoints above are free and ungated, that’s where every Vercel AI SDK agent should start. When you need report-grade enrichment on a named startup, the deep signal runs at €0.19 / call €19 buys 100 credits, credits never expire, and a miss (an org we don’t track) is free.
Prefer to pay per call with no API key? The same endpoint speaks x402 settle in USDC on Base, $0.19/call, no signup.
Stuck on the wire-up?
Email signals@gitdealflow.com, replies within 24 hours, EU business time. Include the framework name and the error in the message body and a snippet of your tool definition.
Email support