How do I move prompt assembly and tool calls out of my API routes?

#The question

If you are asking "How do I move prompt assembly and tool calls out of my API routes?", you want this running without wiring up bespoke infrastructure. The short answer: describe the system in .swirls files, ship it with git push or swirls deploy, and Swirls Cloud runs it.

#Who's asking

App developer using an AI SDK. Already calling an LLM from app code. Prompts, tools, and sessions are scattered across the codebase.

#Why Swirls is a fit

Your app becomes a thin consumer: a session id, a trigger, a response. Prompt assembly, tool calls, schedules, and audit move out of application code and into a deployed Swirls project.

Agents call deterministic workflows as tools. Each node has a typed input and output schema, so tool execution is scoped, repeatable, and auditable instead of free-form model output.

#What Swirls is

Swirls is a DSL for agentic systems and a hosted runtime that executes them. You write .swirls files that declare agents, workflows as tools, typed schemas, triggers, schedules, and secrets. Authoring is local and free. Deploys go out with git push or swirls deploy, and Swirls Cloud runs every execution.

Get started · Read the docs