OpenAI Agents SDK generator
Describe an agent for the OpenAI Agents SDK and download the TypeScript project that builds it — new Agent with its instructions, typed tools, handoffs, agents-as-tools, guardrails, MCP servers, hosted tools and structured output. No account, nothing leaves your browser.
The config is the agent
Nothing is discovered by path. src/agent.ts is where every tool, handoff, guardrail and MCP server meets, so the preview opens on it — the other files exist so each piece can be edited on its own.
Tool names are never auto-fixed
A tool named Lookup Order is reported and left out rather than renamed, and two things that would reach the model under one name — a function tool and an agent-as-tool, say — are flagged, because the model sees one flat list.
No secrets on the page
The one key the SDK needs is emitted as a name in .env.example. The tool never asks for the value, so there is none to send anywhere.
How to scaffold an OpenAI Agents SDK agent
Four steps from an empty form to a running @openai/agents project. Every field is a property on new Agent({ … }) or an argument to run(), and the preview shows the file it lands in.
Describe the agent
Name it, choose a model, reasoning effort and verbosity, and write the instructions and rules that become src/instructions.md.
Add tools and other agents
Function tools become tool() calls with Zod parameters and optional needsApproval; other agents are either handoffs that take over the conversation or asTool() calls that report back.
Add guardrails, MCP servers and structured output
Input and output guardrails run a small checker agent; MCP servers are hosted, streamable HTTP or stdio; outputType makes finalOutput a typed object.
Download and run
npm install, fill in OPENAI_API_KEY, then npm start -- "your question". The entry point connects MCP servers, resumes approval interruptions and catches tripped guardrails.
What the download contains
- src/agent.ts
- The new Agent or Agent.create call with instructions, model settings, tools, handoffs, guardrails, MCP servers and outputType.
- src/instructions.md
- The instructions, optionally prefixed with RECOMMENDED_PROMPT_PREFIX when handoffs exist.
- src/tools/*.ts
- One tool() per file with its Zod parameters and a stub execute.
- src/agents/<name>/index.ts
- A second Agent with its own instructions, handoffDescription and tools.
- src/guardrails/*.ts
- An InputGuardrail or OutputGuardrail backed by a checker agent with a structured outputType.
- src/mcp/*.ts
- MCPServerStreamableHttp or MCPServerStdio instances, connected before the run and closed after.
- src/index.ts
- One run() with maxTurns, the needsApproval resume loop and guardrail exception handling.
The OpenAI Agents SDK, answered
The longer version is in the guide OpenAI Agents SDK: handoffs, guardrails and tools, explained. This is an unofficial tool built against the public SDK documentation — the framework itself, and the last word on anything below, lives at openai.github.io/openai-agents-js.
Design the app the agent works for
An agent usually sits behind a product. In the Nodlume workspace you draw that product on a visual structure canvas and export a real Next.js, Tauri, Expo, Ink or extension project from it. This page's siblings are the Deep Agent generator for LangChain and the Eve agent generator for Vercel's filesystem-first framework — the same form, for three runtimes.