> ## Documentation Index
> Fetch the complete documentation index at: https://opentools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> How OpenTools works under the hood

When you choose a hosted tool from our [registry](https://opentools.com/registry?category=api), we will execute the tool call and ground the response for you. This setup performs your LLM and tool calls happen in one HTTP roundtrip rather than multiple.

<div className="flex justify-center">
  <img className="max-w-md" width="500" src="https://mintcdn.com/opentools/mM27skmF9L2v_1zE/images/diagram.png?fit=max&auto=format&n=mM27skmF9L2v_1zE&q=85&s=97235ed2fb95be37f362ea0e65978189" alt="Tool Use Architecture Diagram" data-path="images/diagram.png" />
</div>

## Generations and Calls

There are two main objects.

* A **Call** (ID prefix `call_`) is either an LLM call or a tool call. Calls happen sequentially — for example, an LLM call might result in a tool call, whose result needs to be fed into another LLM call. Every call belongs to a Generation (many-to-one).
* A **Generation** (ID prefix `genr_`) are 1-to-1 with requests to create a chat completion. They create between 1 and 9 child Calls (LLM → Tool → LLM → ... → LLM), depending on how many tool calls the model wants. If there's no resolution by the 9th call in the sequence, we return the final LLM call as-is to prevent runaway costs.

## MCP client abstraction

Under the hood, OpenTools is a [Model Context Protocol](https://spec.modelcontextprotocol.io/specification/2024-11-05/architecture/) (MCP) client. We handle the underlying protocol implementation details for you.

This abstraction lets you benefit from the power of MCP tools via API without having to implement an MCP client yourself. You get the power of augmented LLMs with minimal integration effort.
