- Define an agent with identity, goal, and persona
- Test your agent in the Studio chat and read trace output
- Define tool contracts (inline, HTTP, MCP, and sandbox)
- Create reusable tool files and import them
- Handle tool results and errors
Prerequisites
- An Agent Platform account with at least one project
- Access to Studio (the visual development environment)
- Familiarity with YAML-like syntax (helpful but not required)
What you’ll build
You start by creating a simple agent — a coffee shop greeter that answers customer questions using nothing but an LLM. Then you build a travel assistant agent with tools that fetch real data from external APIs. Together, these two exercises cover the full foundation of agent development in ABL.Create your first agent
Step 1: Create a new project
Open Studio and select New Project from the dashboard. Name itbean-and-brew and select Blank Project as the template.
Studio creates the project and opens the editor.
Step 2: Define the agent
Create a new agent file namedgreeter.agent.abl. Paste the following ABL definition:
FLOW block to give an agent structured steps (covered in the next tutorial), but without one the agent handles conversations entirely through LLM reasoning.
Step 3: Understand the key blocks
Here is what each block does: AGENT — The unique name for your agent. Use underscores instead of spaces. EXECUTION — Specifies which LLM model powers the agent. GOAL — The agent’s primary objective. The LLM uses this as its core instruction. Use the pipe (|) character for multi-line text.
PERSONA — Defines the agent’s personality and communication style. This shapes the tone of every response.
LIMITATIONS — Explicit boundaries the agent must not cross. The LLM respects these constraints during reasoning.
INSTRUCTIONS — Step-by-step guidance for how the agent should handle conversations.
Step 4: Test in Studio chat
Open the Chat panel in Studio. Type a message:Step 5: Review the trace output
Open the Traces panel in Studio. Select the most recent session to see the full execution trace. The trace shows:- Input — The user message received
- Reasoning — How the LLM interpreted the message against the goal and instructions
- Output — The response generated
- Latency — Time taken for each step
Step 6: Refine the persona
Update thePERSONA block to add more character:
Step 7: Add a completion condition
Add aCOMPLETE block to define when the conversation is finished:
COMPLETE block tells the Runtime when to end the session. Without it, the conversation continues until the user disconnects or the session times out.
Full greeter definition
Here is the completegreeter.agent.abl file:
Add tools to your agent
Now that you have a working agent, give it the ability to call external APIs. You define tools three different ways: inline contracts, HTTP bindings, and MCP bindings.Step 8: Define an inline tool contract
Create a new agent file namedtravel_assistant.agent.abl with an inline tool definition:
TOOLS block defines the contract for each tool: its name, parameters with types, return type, and a description. The Runtime resolves these contracts to actual implementations at deployment time.
Step 9: Create a reusable tool file
When multiple agents share the same API, define tools in a separate.tools.abl file. Create tools/hotels-api.tools.abl:
base_url, auth, timeout, retry) apply to every tool in the file. Each tool specifies its HTTP binding: endpoint path, method, and description.
Step 10: Import tools from the tool file
Update your agent to import tools from the shared file usingFROM ... USE:
- Imported HTTP tools (
search_hotels,get_hotel) — loaded from the shared file with full HTTP binding - Contract-only tool (
format_results) — the Runtime injects the implementation at deployment time - MCP tool (
get_weather) — connects to an external MCP server for weather data
Step 11: Tool binding reference
ABL supports several tool execution types. Here is a reference for the most common ones:Step 12: Handle tool results in a flow step
When you use tools inside a flow section (covered in the next tutorial), you handle results explicitly withON_SUCCESS and ON_FAIL:
ON_SUCCESS block runs when the tool call returns data. The ON_FAIL block runs when the tool call fails or returns no results. Both can include RESPOND messages and THEN transitions to other steps.
Step 13: Use CALL WITH for explicit parameters
For more control over tool parameters, useCALL ... WITH syntax:
WITH block maps session variables to tool parameters. The AS keyword binds the tool result to a named variable. ON_RESULT provides multi-way branching based on the result values.
Step 14: Test tool execution
Open the Chat panel in Studio and start a conversation:- The agent receives the user message
- The LLM decides to call
search_hotelswith the extracted parameters - The Runtime executes the HTTP request
- The tool result flows back to the agent
- The agent formats and presents the results
- Parameters sent — The actual values passed to the tool
- Response received — The raw data returned
- Latency — How long the tool call took
- Status — Whether the call succeeded or failed
Full travel assistant definition
What you learned
- AGENT, GOAL, PERSONA, and INSTRUCTIONS define your agent’s identity and behavior
- Agents reason by default, using the LLM for every response; adding a
FLOWblock is optional for structured steps - LIMITATIONS set explicit boundaries the agent respects
- COMPLETE defines when the session ends
- Studio’s chat panel lets you test agents interactively; trace output shows the full reasoning chain
- Inline tool contracts define a tool’s name, parameters, return type, and description
- Tool files (
.tools.abl) let you share tools across agents with shared configuration - FROM … USE imports specific tools from a tool file
- ABL supports four tool types: http, mcp, sandbox, and contract-only
- ON_SUCCESS / ON_FAIL handle tool results; CALL … WITH … AS gives explicit parameter control
- ON_RESULT enables multi-way branching based on tool return values
- Tool calls appear as individual spans in the Studio trace view
Related articles:
- Add structured steps to an agent — Create step-by-step guided conversations with FLOW, GATHER, and branching.
- Multi-agent and knowledge — Connect multiple agents through a supervisor and add a knowledge base.