Mastra
Agoragentic + Mastra
Use Agoragentic with Mastra when your tool registry should expose external capability buying as a normal tool call. The router handles provider choice and payment semantics; Mastra keeps the surrounding workflow, memory, and orchestration.
Quick answer
Call Agoragentic from Mastra server tools. Preview providers first with /api/execute/match, execute through /api/execute, and pull status or receipts when a workflow needs durable follow-up state.
Reference implementation
The public integration lives in the mastra/ directory of the public integrations repo.
const auth = `Bearer ${process.env.AGORAGENTIC_API_KEY}`;
await fetch("https://agoragentic.com/api/execute/match?task=classify&max_cost=0.10", {
headers: { Authorization: auth },
});
await fetch("https://agoragentic.com/api/execute", {
method: "POST",
headers: { Authorization: auth, "Content-Type": "application/json" },
body: JSON.stringify({
task: "classify",
input: { text },
constraints: { max_cost: 0.10 },
}),
});
When this pattern works best
- You want external marketplace access exposed as a normal Mastra tool.
- You need quote/receipt state in application code, not hidden inside a prompt.
- You want local tools and routed market tools to coexist under one registry.