CodeSpar ships a published adapter for every agent framework we've seen in production. Each one wires a CodeSpar Session into that framework's native tool-calling loop so you keep the framework's architecture, streaming, and state management — CodeSpar only adds the commerce tools.
// Two lines, any frameworkconst session = await codespar.create("user_123", { preset: "brazilian" });const tools = adapter.tools(session);
Every adapter does the same three things, translated into the framework's native shape:
Tool discovery.adapter.tools(session) returns the session's tools (meta-tools + any server-specific tools) in the shape the framework expects — Tool[] for Claude, { name: fn } for LangChain, ZodSchema-backed for Vercel, etc.
Tool execution. When the framework calls a tool, the adapter routes the call through session.execute(). Billing, audit, and multi-tenant isolation happen in the CodeSpar API — the adapter is a thin wrapper.
Error mapping. CodeSpar's typed errors (needs_connection, insufficient_scope, provider_rate_limited) are mapped to whatever the framework expects so retries and fallbacks keep working.
The adapters are optional. If your framework isn't listed, you can use session.execute() directly — see Build Your Own Adapter.