Inside run(): how the tool-calling loop works
Making a tool available is not the same as calling it. A walk through one run() request: the model, the instructions, the tools, and the loop Agent200 executes until the answer is ready.
2 min read

Agent200 is not a passive API proxy. Inside a single run() request it invokes the model you chose, hands it the tools you allowed, executes the tool calls the model makes, and keeps going until the request is complete. Here is what happens inside that loop.
One request, five inputs
A request names the end user, the model, the instructions, the task and the tools the model may use.
Conceptual example.
const result = await agent200
.user("user_123")
.run({
model: "openai/gpt-5.6-sol",
instructions: "You are a productivity assistant. Use the available tools when necessary.",
input: "Retrieve the latest LinkedIn post from XYZ. If today is Sunday, also prepare my brief.",
tools: ["brief", "linkedin"],
});
| Input | What it decides |
|---|---|
user |
Whose authorized connections the tools use |
model |
Which AI model processes the request and drives the loop |
instructions |
How the model should behave for this request |
input |
The actual task |
tools |
Which configured capabilities the model may call |
The loop
- Agent200 gives the model the definitions of the tools you allowed.
- The model reads the task and decides whether it needs a tool.
- When it asks for one, Agent200 executes the operation through the connector or workflow behind it, for the user you named.
- The result goes back to the model.
- The model reasons further, calls another tool, or writes its final answer.
Your application receives the finished result and carries on with it, inside whatever larger workflow your agent runs.
Available is not the same as called
Look at the request again. Both linkedin and brief are available, but the input only asks for the brief on Sundays. On a Sunday the model may call both tools. On a Tuesday it calls only the LinkedIn capability.
Listing a tool makes it possible. The model decides, during execution, whether it is needed.
One practical note: a decision like this depends on the date. Give the model the current date in the instructions or the input, and it can make the call reliably.
Tools inside tools
A single tool call can run a whole workflow. When the model calls brief, Agent200 runs every operation configured inside it and returns one combined result:
run()
└─ model calls: brief
└─ workflow
├─ chat messages
└─ recent email
└─ combined result → model → final answer
The model never needs to know the endpoints inside brief. It only needs to understand what the capability does and which inputs it takes.
The right model for each request
Different requests can use different models: a fast one for a simple lookup, a stronger one for a multi-step task. The model you select for a request is the one that runs its loop.
See the full execution path on the Platform page.


