Thuta Learning
ProjectsAIbeginner

Agent Tools and Actions

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand Agent Tools and Actions without any of the intimidation
  • Get hands-on practice trying it yourself
  • Learn to spot — and smile past — the easy-to-make mistakes

Learn how function calling lets a model choose a tool, while the application safely executes the action.

Let's think about it this way for a second

You're not handing the model a database password and letting it act directly. The developer defines the tool name, description, and JSON schema, and the model submits a tool call. The application validates the arguments and checks permissions before it actually executes the function.

Agent Tools and Actions lesson illustration
Agents, Privacy, and Project — Agent Tools and Actions

Let's connect this to everyday life

Give each tool a single responsibility and keep its parameters precise. Don't build one giant "manage_everything" tool. Separate read tools from write tools, and use confirmation or an idempotency key for write actions.

Let's try it hands-on together

javascript
const tools = [{
  type: "function",
  name: "get_weather",
  description: "မြို့တစ်မြို့၏ လက်ရှိမိုးလေဝသကို ရယူရန်",
  parameters: {
    type: "object",
    properties: { city: { type: "string" } },
    required: ["city"],
    additionalProperties: false,
  },
  strict: true,
}];
You should see
You'll be able to define a read-only agent tool with a precise schema.

5-minute try-it

Write a course search tool and a separate enrollment write tool. Add a rule requiring user confirmation before enrollment happens.

A quick word of caution

Don't treat AI output as the final word. Have a human review anything important — including code and user data — before it's actually used.

OpenAI — Function callingOpenAI

OpenAI Agents SDKOpenAI

Easy traps

  • Executing the model's arguments without validating them
  • Bundling read and destructive-write actions into a single tool

Exercise

Write a course search tool and a separate enrollment write tool. Add a rule requiring user confirmation before enrollment happens.

You'll know it worked when: You'll be able to define a read-only agent tool with a precise schema.

Agent Tools and Actions | Thuta Learning