OpenAI Agent Builder: Build Your Own AI Operator Without Code
You’ve heard the hype about AI agents that can read email, qualify leads, and send invoices, but the tutorials either skip the hard parts or assume you already know JSON schema. After reading this you’ll be able to spin up a functional agent, see where it breaks, and know exactly what to tweak.
What most guides get wrong about the OpenAI Agent Builder
Most tutorials start with a blank playground and tell you to “describe your agent in plain English.” They never mention that the builder expects a strict JSON schema for tools, and if you miss a single comma the whole thing fails silently. I’ve seen beginners waste an hour staring at a green “Save” button that never activates because the schema validation error is hidden in the console.
The other common mistake is treating the agent like a chatbot. The builder shines when you give it external tools—like a web scraper or a CRM API—yet the default examples only show internal reasoning. If you don’t add a tool, the agent can’t do anything useful beyond repeating back your prompt.
Why does my agent keep hallucinating on simple queries?
Hallucinations happen when the model tries to fill gaps with plausible‑sounding fiction instead of admitting it doesn’t know. In the Agent Builder this often shows up when the tool description is vague or when the tool returns an empty array and the agent still tries to summarize it.
Fix it by making your tool description explicit about what it returns and what it means when it returns nothing. For example, instead of “Get recent posts from a blog,” write “Returns an array of objects with fields title, url, and date; if no posts are found return an empty array.” Then add a short instruction in the agent’s system prompt: “If the tool returns an empty array, say you found no recent posts and stop.”
Another trick is to lower the temperature to 0.2 for the reasoning step; higher temperatures make the model more creative, which is the opposite of what you want when you need factual answers.
A concrete named example: building a lead‑qualification agent with real prompts and cost
Let’s walk through a real agent I built last month for a freelance outreach pipeline. The goal: take a LinkedIn URL, pull the person’s headline and company, then decide if they match our ideal customer profile.
Tools used
- Apify – a ready‑made actor that scrapes a LinkedIn public profile and returns JSON with headline, company, and location.
- OpenAI Agent Builder – to orchestrate the scrape and run the qualification logic.
Tool definition (JSON)
{
"name": "linkedin_scraper",
"description": "Scrapes a public LinkedIn profile. Input: { \"url\": \"string\" }. Output: { \"headline\": \"string\", \"company\": \"string\", \"location\": \"string\" }.",
"parameters": {
"type": "object",
"properties": {
"url": { "type": "string" }
},
"required": ["url"]
}
}
Agent system prompt
You are a lead‑qualification assistant. Use the linkedin_scraper tool to get the prospect’s headline and company. If the headline contains any of the words “founder”, “CEO”, “CTO”, or “VP” and the company is a SaaS or B2B tech firm, output \"QUALIFIED\". Otherwise output \"NOT QUALIFIED\". If the tool returns an empty object, say you could not retrieve the profile and stop.
Real run and cost
I ran 150 scrapes over two days. Each Apify execution costs about $0.004, and the OpenAI token usage for the agent’s reasoning averaged 600 tokens per run (roughly $0.006 at GPT‑4‑turbo pricing). Total cost: (150 × $0.004) + (150 × $0.006) = $0.60 + $0.90 = $1.50. That’s less than a coffee for a fully automated lead‑qualification step.
What I love: the agent’s ability to chain the tool call and the decision logic in a single prompt loop—no extra code needed. What annoyed me: the builder’s error messages show up only in the browser console, so if you’re testing on a mobile device you miss them entirely.
