Skip to main content
Build a customer greeting agent, then extend it with tools that connect to external APIs. By the end, you know how to:
  • 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 it bean-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 named greeter.agent.abl. Paste the following ABL definition:
This is a complete agent definition. Every agent reasons by default — it uses the LLM to decide how to respond to each message. You can optionally add a 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:
The agent responds with a greeting matching the persona you defined — warm, friendly, coffee-themed. Try a few more messages:
The agent answers menu and hours questions based on its instructions, and politely declines order requests per its limitations.

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
Each message exchange appears as a separate trace event. This is your primary debugging tool for understanding why an agent responded a certain way.

Step 6: Refine the persona

Update the PERSONA block to add more character:
Test again in the chat. Notice how the agent now introduces itself as Alex and makes more personalized recommendations.

Step 7: Add a completion condition

Add a COMPLETE block to define when the conversation is finished:
The 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 complete greeter.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 named travel_assistant.agent.abl with an inline tool definition:
The 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:
The file-level settings (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 using FROM ... USE:
This agent uses three types of tools:
  • 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 with ON_SUCCESS and ON_FAIL:
The 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, use CALL ... WITH syntax:
The 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:
Open the Traces panel to see the tool execution:
  1. The agent receives the user message
  2. The LLM decides to call search_hotels with the extracted parameters
  3. The Runtime executes the HTTP request
  4. The tool result flows back to the agent
  5. The agent formats and presents the results
Each tool call appears as a separate span in the trace tree. Select a tool span to see:
  • 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 FLOW block 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

Next Steps

Check out the Template Gallery in Studio for ready-made agent definitions across use cases — customer support, e-commerce, banking, and more.