How To Use OpenAI Agent Builder For Advanced Users
By corbin
Key Concepts
- OpenAI Agents: AI entities capable of performing tasks by interacting with tools and processing information.
- Zapier MCP (Multi-Channel Protocol): A Zapier feature that allows OpenAI agents to access and interact with over 8,000 applications and their APIs.
- Payload Formatter: An agent designed to extract and structure data (payload) from user input into a standardized format, typically JSON.
- JSON Schema: A declarative language used to define the structure and validation rules for JSON data.
- Reasoning Effort (Low/High): A setting in agent builders that dictates the AI's cognitive load. "Low" is for simple data extraction, "High" is for complex tasks requiring self-correction and tool usage.
- Set State: A mechanism within agent workflows to store and pass dynamic data (variables) between different agent blocks, making it accessible throughout the entire workflow.
- Bumpup's API: A third-party API used in this workflow to analyze YouTube video content and answer questions about it.
- YouTube Data API: Google's API for accessing YouTube data, used here to retrieve video metadata like thumbnail, title, and duration.
- Custom Widget UI: A user interface component created dynamically by an agent to display specific data in a visually appealing format within the chat output.
- API Key: A unique identifier used to authenticate and authorize access to an API.
- Metadata: Data that provides information about other data, such as a video's title, duration, or thumbnail URL.
- Enum (Enumerated Type): A data type that consists of a set of named values, often used for predefined options (e.g.,
bump-1.0for a model,textfor output format). - String, Number, Boolean: Fundamental data types used to define the nature of variables (text, numerical value, true/false).
state.variableName: A syntax used within the agent builder to dynamically access variables that have been stored in the workflow's "state."
Introduction and Workflow Overview
The video demonstrates building a practical OpenAI agent using Zapier's Multi-Channel Protocol (MCP) to create a YouTube bot. Unlike generic examples, this bot offers a real-world use case: analyzing any YouTube video link, answering user-specific questions about its content, and presenting key video metadata (thumbnail, title, duration) in a custom chat widget. The workflow is designed to be free-form, allowing users to ask diverse questions like "key points," "X tweets," "blog post," or "top 10 quotes." Zapier sponsors this video, highlighting its role in empowering OpenAI agents with access to over 8,000 applications.
The demonstration showcases a preview where a user inputs a YouTube link and a prompt like "what are the three main points about this video." The bot processes this, extracts the main points, and then displays a custom widget containing the video's thumbnail, title, and duration.
Building the YouTube Bot Workflow
The process involves setting up three main agent blocks within the OpenAI Agent Builder. This video is part of a larger series that will eventually cover deploying this code to a real website using Chatkit.
1. Agent Block: Data Grabber / YouTube Helper
- Purpose: This initial agent's sole function is to extract the user's YouTube URL and their question (prompt) from the input message and format it into a structured payload.
- Prompt: "You are a payload formatter. User will provide the YouTube URL and set it as a JSON schema for URL. And then the user will ask a question about the video and set that for the prompt."
- Payload: A developer term for data being sent between different software components.
- Dynamic Variables: The prompt uses "setting" to establish dynamic variables (
URL,prompt) that will be updated with each new user session.
- Output Format: JSON.
- Model:
Steco DBT5is recommended for beginners as a "one-size-fits-all" model. - Reasoning Effort: Set to Low. Since this agent only extracts and formats data without complex reasoning, a low reasoning effort is faster and sufficient.
- Schema Configuration (Simple):
- Payload Name:
user data. - Properties:
relevant URL: Typestring(for the YouTube link).prompt: Typestring(for the user's question).
- Importance of Data Types: The video emphasizes selecting the correct data type (string, number, boolean) to prevent errors when sending payloads to third-party applications. It suggests using AI models like ChatGPT to confirm correct API data types.
- Naming Convention: Naming the properties
URLandpromptis crucial for later integration with Bumpup's API.
- Payload Name:
- Testing: A preview test confirms that the agent correctly extracts the YouTube URL into the
URLparameter and the user's question into thepromptparameter, visible in the "evaluate" section under "post response." This structured output makes the user's natural language input legible for AI processing.
2. Passing Data in Complex Workflows: Set State
- Challenge: In complex workflows, data extracted by one agent isn't automatically accessible by subsequent agents.
- Solution: The "Set State" block is used to assign extracted data to workflow-level variables, making them globally accessible.
- Process:
- Connect the "Set State" block after the "YouTube Helper."
- Assign Values: Map the data from the
user datapayload to new variables:URL(fromuser data) is assigned toYouTube URL(workflow variable).prompt(fromuser data) is assigned toprompt(workflow variable).- Additional variables for Bumpup's API parameters are also set:
model,language,output format.
- Recommendation: Use consistent naming for variables (e.g.,
modelfor both the payload property and the workflow variable) to avoid confusion.
- Benefit: This fundamental skill allows data to be passed and utilized throughout the entire workflow, regardless of its complexity.
3. Agent Block: YTBot (Core Logic and API Integration)
- Purpose: This agent performs the core task of analyzing the YouTube video content using external APIs.
- Tools: Zapier MCP Server.
- Setup: Create a new MCP server named
YTbot, selectingOpenAI APIas the client. - Adding Tools:
- YouTube: Add the
find videoaction to retrieve video metadata. - Bumpup's API: Add the
send chataction. This API allows asking specific questions about a YouTube video given its link. Other Bumpup's functions (e.g., generating timestamps) are available but not used in this specific workflow.
- YouTube: Add the
- Connecting Accounts: Standard API key retrieval process (e.g., for Bumpup's: Profile -> Settings -> API -> Create API Key). The secret key is copied and pasted into the Zapier MCP connection.
- Setup: Create a new MCP server named
- Reasoning Effort: Set to High. For agents performing complex tasks involving external API calls and potential errors, "High" reasoning allows the agent to self-correct and intelligently handle issues, preventing it from "running into a wall."
- Prompt Construction:
- The prompt includes the expected data structure for the Bumpup's
send chatpayload, copied directly from the MCP tool documentation. - Payload for Bumpup's
send chat:URL:state.YouTube URLmodel:state.model(e.g.,bump-1.0, anenumtype)prompt:state.promptlanguage:state.language(e.g.,English, astringtype)output format:state.output format(e.g.,textormarkdown, anenumtype)
state.variableNameExplanation: This syntax (state.YouTube URL) is used to dynamically access the variables previously stored in the "Set State" block, ensuring the agent uses the correct, user-provided data.- Final Instruction: "Use the MCP tool and receive its response and put it in chat."
- The prompt includes the expected data structure for the Bumpup's
4. Agent Block: Custom Widget UI (YT UI)
- Purpose: This agent is responsible for fetching additional video metadata and displaying it in a custom-designed widget within the chat output.
- Tools: Zapier MCP Server (using the same API key).
- Tool: YouTube
find video(its sole purpose here).
- Tool: YouTube
- Prompt Construction:
- The prompt specifies the
YouTube find toolaction and requests specific variables:URL,max res,duration, andtitle. - Identifying Variable Names:
- Option 1 (API Documentation): Consult the YouTube Data API documentation (e.g.,
search.listevent) to find parameter names likevideoDurationorURL max resfor high-resolution thumbnails. - Option 2 (AI Model): Ask an AI model (e.g., ChatGPT) "YouTube API, what is the API data point for the duration of a video?"
- Option 1 (API Documentation): Consult the YouTube Data API documentation (e.g.,
- Specific Details:
URL max resis chosen for the best thumbnail quality. - Instruction: "Then place in widget."
- The prompt specifies the
- Widget Creation:
- Use the "Text Check Widget" and "Add Widget" feature.
- Prompt for Widget Creator: "We need a YouTube widget that will showcase video thumbnail, URL, max res, video duration, and title."
- Tip: Emphasizes the importance of a precise initial prompt for the widget creator to avoid errors. If errors occur, retrying with a better prompt is recommended.
- Upload Widget: The generated
.widgetfile is downloaded and then uploaded back into the agent builder. The low-resolution preview is noted as temporary, as the actual data will populate it during runtime. - Final Instruction: "Here is a YouTube video add context YouTube URL." (To link the widget to the specific video).
Workflow Testing and Refinements
The complete workflow is tested with a prompt like "what is the best quote from this video" and a YouTube link.
- Execution Flow:
- Data extraction (user's prompt and URL).
- Data is set as variables for
YTbotandYT UI. YTbotinitiates, analyzing the video via Bumpup's API to find the quote.- Approval Step: The agent pauses for user approval before executing the tool.
- Disabling Approval: This can be turned off by navigating to the bot's settings:
Bot->Tools->Zapier->Approval-> "Never require approval for any tool" ->Update.
- Disabling Approval: This can be turned off by navigating to the bot's settings:
YT UIinitiates, fetching video metadata and displaying the custom widget with the thumbnail, title, and duration.
- Example Output: The bot successfully extracts a quote from the video ("This is a developer heavy, but don't worry. I'm going to make it sound very easy, almost like you're going to McDonald's and ordering your favorite Happy Meal.") and displays the video's metadata in the widget.
Conclusion and Future Plans
This detailed workflow demonstrates how to build a powerful OpenAI agent capable of interacting with external APIs (YouTube, Bumpup's) via Zapier MCP to provide specific, actionable insights from YouTube videos and present them in a custom UI. The creator plans to further develop this project, making all the code open-source and freely available on GitHub, and expanding its capabilities in future videos. Zapier's integration significantly enhances the power of OpenAI agents by providing access to a vast ecosystem of over 8,000 applications.
Chat with this Video
AI-PoweredLoad the transcript when you're ready to chat so the initial page stays lighter.
Related Videos

Why Does This Guy Appear In Kids Videos?
sphynx

TIC en las Organizaciones - Electiva Complementaria II Unisimon
Julieth Güell S

How to Tame Your Advice Monster | Michael Bungay Stanier | TED
TED

Margaret Heffernan: Why it's time to forget the pecking order at work
TED

The importance of psychological safety: Amy Edmondson
The King's Fund

What Is Psychological Safety?
Harvard Business Review

13-Conflict Management: Listening in Conflict
Deliberate Development