---
title: "Connect Mariana Tek to AI Agents: Orchestrate Bookings & Retail"
slug: connect-mariana-tek-to-ai-agents-orchestrate-bookings-retail
date: 2026-11-19
author: Nachi Raman
categories: ["AI & Agents"]
excerpt: "Learn how to safely connect Mariana Tek to AI agents using Truto's tools endpoint to autonomously orchestrate class reservations, waitlists, and retail checkouts."
tldr: "Connect Mariana Tek to AI agents securely by abstracting raw JSON:API schemas. This guide demonstrates how to fetch LLM-ready tools, bind them to frameworks like LangChain, and handle API rate limits natively."
canonical: https://truto.one/blog/connect-mariana-tek-to-ai-agents-orchestrate-bookings-retail/
---

# Connect Mariana Tek to AI Agents: Orchestrate Bookings & Retail


You want to connect Mariana Tek to an AI agent so your system can autonomously orchestrate class bookings, handle waitlist assignments, process retail checkouts, and manage customer memberships based on historical context. Here is exactly how to do it using Truto's `/tools` endpoint and SDK, bypassing the need to build a custom JSON:API connector from scratch.

Giving a Large Language Model (LLM) read and write access to your Mariana Tek instance is an engineering headache. Boutique fitness studio management requires strict transactional safety. You either spend weeks building, hosting, and maintaining a custom connector that handles complex data nesting, or you use a managed infrastructure layer that handles the boilerplate for you. If your team uses ChatGPT, check out our guide on [connecting Mariana Tek to ChatGPT](https://truto.one/connect-mariana-tek-to-chatgpt-manage-classes-sales-user-accounts/), or if you are building on Anthropic's models, read our guide on [connecting Mariana Tek to Claude](https://truto.one/connect-mariana-tek-to-claude-automate-billing-shifts-roster/). For developers building custom autonomous workflows, you need a programmatic way to fetch these tools and bind them to your agent framework.

This guide breaks down exactly how to fetch AI-ready tools for Mariana Tek, bind them natively to an LLM using frameworks like LangChain, LangGraph, CrewAI, or the Vercel AI SDK, and execute complex retail and reservation workflows. For a deeper look at the architecture behind this approach, refer to our research on [architecting AI agents and the SaaS integration bottleneck](https://truto.one/architecting-ai-agents-langgraph-langchain-and-the-saas-integration-bottleneck/).

## Why a Unified Tool Layer Matters for Agent Safety

Before writing a line of integration code, decide what layer your agent talks to. This choice determines how safe your production system will be when modifying class rosters or charging credit cards.

Direct API tools (one tool per raw Mariana Tek endpoint) look convenient but they push provider quirks into the LLM's context. The model has to remember exactly how Mariana Tek structures its payloads, how class layouts interact with spot types, and how carts require specific relationship mappings before checkout. Every one of those quirks is a [hallucination waiting to happen](https://truto.one/what-is-llm-function-calling-for-integrations-2026-guide/).

A unified tool layer collapses these complexities behind a [strictly typed schema](https://truto.one/what-is-llm-function-calling-for-integrations-2026-guide/). Your agent sees `create_a_mariana_tek_reservation`, `mariana_tek_carts_add_product`, and `mariana_tek_reservations_check_in`. That gives you concrete safety wins:

1. **Smaller attack surface for hallucination.** The LLM only ever chooses from stable function names. It never invents JSON wrappers or invalid UUID strings.
2. **Deterministic input validation.** Every tool has a strict JSON schema. Invalid arguments are rejected before they hit Mariana Tek, so a broken tool call fails fast instead of creating orphaned data records.

## The Engineering Reality of the Mariana Tek API

Giving an LLM access to external fitness management data sounds simple in a prototype. You write a Node.js function that makes a fetch request and wrap it in an `@tool` decorator. In production against complex operational systems like Mariana Tek, this approach collapses.

Mariana Tek's API introduces several specific integration challenges that break standard REST assumptions. If you hardcode these interactions into your agent, you will spend your sprints writing defensive integration code instead of improving your model's reasoning.

### The JSON:API Specification Trap

Mariana Tek strictly adheres to the JSON:API specification. Standard LLMs are trained to expect flat, intuitive JSON objects. When an agent wants to create a reservation, it naturally attempts to send a payload like `{"class_session": 12345, "user": 67890}`.

Mariana Tek will reject this immediately. The API requires a heavily nested structure defining the object type and attributes:

```json
{
  "data": {
    "type": "reservations",
    "attributes": {
      "class_session": 12345,
      "user": 67890
    }
  }
}
```

If you expose the raw API to an LLM, it will frequently hallucinate the `data.attributes` wrapper, especially during multi-step tool chains where the context window fills with flat JSON from other tools. Truto's tools abstract this schema requirement, ensuring the LLM only needs to provide the logical variables, while Truto translates the payload into the strict JSON:API format Mariana Tek requires.

### Turf Rules and Multi-Location Complexity

Mariana Tek operates heavily on "Turf" (Location/Region/Site) rules. Creating a stock record for retail products, adjusting inventory, or scheduling an employee shift requires precise location mapping. If an LLM attempts to add a retail product to a cart without specifying the correct fulfillment partner or turf ID, the transaction fails. Truto normalizes these relationships into clear required arguments within the tool schema.

### Explicit Rate Limit Handling

Mariana Tek applies rate limiting to protect tenant stability. It is a critical architectural fact that Truto does not retry, throttle, or apply backoff on rate limit errors. When Mariana Tek returns an HTTP 429 (Too Many Requests), Truto passes that error directly back to the caller.

However, Truto normalizes upstream rate limit information into standardized headers per the IETF specification:
* `ratelimit-limit`: The maximum number of requests permitted.
* `ratelimit-remaining`: The number of requests remaining in the current window.
* `ratelimit-reset`: The time at which the rate limit window resets.

Your agent framework is strictly responsible for inspecting these headers and implementing its own [retry or backoff logic](https://truto.one/how-to-handle-long-running-saas-api-tasks-in-ai-agent-tool-calling-workflows/). Truto will not absorb the 429 error for you.

## Fetching Mariana Tek Tools Programmatically

To give your AI agent access to Mariana Tek, you query Truto's `/tools` endpoint. This returns an array of fully documented, schema-bound functions that any standard LLM framework can ingest.

```bash
curl --request GET \
  --url 'https://api.truto.one/integrated-account/{integrated_account_id}/tools' \
  --header 'Authorization: Bearer YOUR_TRUTO_API_KEY'
```

The response contains tools with JSON schemas describing exact parameters. Our SDKs use this endpoint to register tools natively in frameworks like LangChain. 

## Hero Tools for Mariana Tek

Here are the highest-leverage tools available for orchestrating Mariana Tek workflows. 

### 1. create_a_mariana_tek_reservation

Creates a reservation for a specific user in a specific class session. This tool handles the relationship mapping required by Mariana Tek's backend.

> "Book Sarah Jenkins into the 6:00 AM HIIT class session ID 884732. Use her existing membership credit."

### 2. mariana_tek_reservations_assign_to_spot

Moves a waitlist or standby reservation into an active class. Essential for autonomous agents monitoring class capacities and managing cancellations.

> "A spot just opened up in the 5:30 PM Spin class. Move Mark Davis from the waitlist into spot 12."

### 3. create_a_mariana_tek_cart

Initializes a new shopping cart for a user. This is the first step in processing retail sales, membership purchases, or drop-in class payments.

> "Start a new cart transaction for the user standing at the front desk (User ID 59932)."

### 4. mariana_tek_carts_add_product

Adds a retail product, water bottle, or membership to an existing cart. 

> "Add two bottles of SmartWater (Product ID 44) to the active cart for John Doe."

### 5. create_a_mariana_tek_checkout

Finalizes a basket and converts it into a completed order. This tool requires payment source information, whether cash, saved card on file, or account credit.

> "Checkout cart ID 9923 using the customer's default saved bankcard on file."

### 6. mariana_tek_reservations_check_in

Marks a reserved user as arrived. Used for autonomous kiosk tablets, mobile app integrations, or facial recognition check-in flows.

> "Check in Emily Chen for her upcoming Yoga session. Her reservation ID is 44921."

To view the complete inventory of available Mariana Tek tools and their strict schemas, visit the [Mariana Tek integration page](https://truto.one/integrations/detail/marianatek).

## Workflows in Action

Here is how these tools combine to solve real-world studio operations without human intervention.

### Scenario 1: The Autonomous Front Desk Assistant

A studio member walks in, grabs a retail item, and needs to be checked into their class. They interact with a studio tablet or voice agent.

> "I'm here for the 7 AM class, and I'd like to buy this protein bar. Put it on my card on file."

1. `mariana_tek_reservations_check_in`: The agent checks the user into the class.
2. `create_a_mariana_tek_cart`: The agent creates a new cart attached to the user's ID.
3. `mariana_tek_carts_add_product`: The agent adds the protein bar (looked up via inventory ID) to the cart.
4. `create_a_mariana_tek_checkout`: The agent finalizes the order using the user's stored payment token.

**Result:** The member is checked in and charged for retail seamlessly, bypassing the physical front desk entirely.

### Scenario 2: Smart Waitlist Orchestration

When a popular class has a cancellation, studios lose revenue if the waitlist isn't processed immediately.

> "Someone just cancelled their spot in the fully booked 6 PM Pilates class. Fill the spot and notify the member."

1. `mariana_tek_class_sessions_cancel`: The agent processes the cancellation for the user dropping out, freeing the spot.
2. `mariana_tek_reservations_assign_to_spot`: The agent automatically identifies the first person on the waitlist and moves them to the active roster.
3. `mariana_tek_class_sessions_message`: The agent sends an automated SMS/email notifying the newly booked member that they made it into the class.

**Result:** Class utilization remains at 100%, and members receive instant notifications without staff manual intervention.

## Building Multi-Step Workflows

Building an agent that chains these tools requires an architecture that can handle Mariana Tek's rate limits and strictly typed inputs. Using the Truto LangChain SDK (`TrutoToolManager`), you can bind these tools to an LLM and implement the necessary 429 backoff logic.

```mermaid
sequenceDiagram
    participant Agent as AI Agent
    participant Truto as Truto Unified API
    participant MTek as Mariana Tek API

    Agent ->> Truto: Call create_a_mariana_tek_reservation
    Truto ->> MTek: POST /reservations (JSON:API format)
    MTek -->> Truto: 429 Too Many Requests
    Truto -->> Agent: 429 Error (ratelimit-reset header)
    Note over Agent: Agent parses header<br>waits for reset time
    Agent ->> Truto: Retry create_a_mariana_tek_reservation
    Truto ->> MTek: POST /reservations
    MTek -->> Truto: 201 Created
    Truto -->> Agent: Tool execution success
```

Here is how you initialize the agent and handle execution in TypeScript:

```typescript
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { TrutoToolManager } from "truto-langchainjs-toolset";

async function runMarianaTekWorkflow() {
  // 1. Initialize the LLM
  const llm = new ChatOpenAI({ 
    modelName: "gpt-4o", 
    temperature: 0 
  });

  // 2. Fetch Mariana Tek tools for the specific studio account
  const toolManager = new TrutoToolManager({
    apiKey: process.env.TRUTO_API_KEY,
  });
  const tools = await toolManager.getTools(process.env.MARIANA_TEK_ACCOUNT_ID);

  // 3. Create the prompt and agent
  const prompt = ChatPromptTemplate.fromMessages([
    ["system", "You are a studio management assistant. Handle check-ins and retail sales."],
    ["human", "{input}"],
    ["placeholder", "{agent_scratchpad}"],
  ]);

  const agent = createToolCallingAgent({
    llm,
    tools,
    prompt,
  });

  const executor = new AgentExecutor({
    agent,
    tools,
    maxIterations: 10,
  });

  try {
    const result = await executor.invoke({
      input: "Start a cart for user 88321, add product ID 12 (Protein Shake), and checkout using the default card."
    });
    console.log("Workflow completed:", result.output);

  } catch (error) {
    // IMPORTANT: Truto passes HTTP 429 errors directly. 
    // You must catch them and parse the IETF ratelimit headers.
    if (error.response && error.response.status === 429) {
      const resetTime = error.response.headers.get('ratelimit-reset');
      console.warn(`Rate limit hit. Wait until ${resetTime} before retrying.`);
      // Implement your application-level sleep/retry logic here
    } else {
      console.error("Agent execution failed:", error);
    }
  }
}
```

By leveraging Truto's `/tools` endpoint, you abstract away the JSON:API requirements and nested schemas, allowing the LLM to focus purely on business logic and reasoning. You remain in complete control of your application state, including how to gracefully handle rate limit pauses using standard headers.

## Abstracting the Complexity of Studio SaaS

Connecting AI agents to Mariana Tek requires more than just making API requests. It demands an architecture that protects the LLM from provider-specific payload schemas while safely passing through critical HTTP state data like rate limits. 

Truto's unified tool layer ensures your agent never hallucinates a JSON:API wrapper, never guesses at pagination cursors, and always operates deterministically. You spend your engineering cycles building better AI reasoning, while Truto handles the SaaS integration bottleneck.

> Ready to connect Mariana Tek to your AI agents without the boilerplate? Let's talk about your integration roadmap.
>
> [Talk to us](https://truto.one/book-a-demo/)
