API Tool: Automate Actions by Integrating your Tech Stack

The API Tool enables your TailorTalk AI agent to interact with external RESTful services by configuring endpoints, headers, parameters, and request bodies. This empowers your agent to fetch real‑time data or send information to other systems, enhancing automation and personalization.

TailorTalk Agent API Tool Interface

Adding API Information to Your TailorTalk Agent

  • API Name:
    A friendly label for the endpoint (e.g., Current Weather, Order Submission).

  • Request Type:
    Choose GET to retrieve data or POST to submit data.

  • URL:
    The full endpoint URL (e.g., https://api.openweathermap.org/data).

  • Headers:
    Define any HTTP headers as key‑value pairs, such as Authorization: Bearer <token> or custom keys.

  • Parameters / Body:

    • For GET requests, specify Parameters (query string).
    • For POST requests, define Body fields.
      Each argument includes:
    Property Description
    Name Field name (e.g., q, units, apikey)
    Type Data type (int or str)
    Required Whether the field is mandatory
    Description Brief explanation of the field’s purpose
  • Description (Optional):
    A longer note to help other developers or agents understand this API’s role.


Filtering the API Response

Some APIs answer with far more than your agent needs — hundreds of rows, or rows carrying dozens of fields each. Everything the API returns stays in the agent's context for the rest of the conversation, which makes replies slower and more expensive. Turn on Filter the API response and write one expression naming what to keep.

Where the Expression Starts

Write it against the API's own response, beginning at that API's top-level keys.

When the agent calls the tool it sees {"results": ...} around the data — but that wrapper is added after filtering, so an expression starting with results. will match nothing.

Writing the Expression

Expressions are JMESPath, the same language the AWS CLI uses for its --query option. Suppose the API returns:

{
  "payload": {
    "result": [
      { "name": "Cotton Tee", "sellingPrice": 899, "mainImage": "a.jpg", "description": "..." },
      { "name": "Denim Cap",  "sellingPrice": 499, "mainImage": "b.jpg", "description": "..." }
    ],
    "total": 42
  },
  "configs": { "currency": "INR" }
}
Expression The agent receives
payload.total 42
payload.result[].name ["Cotton Tee", "Denim Cap"]
payload.result[0].name "Cotton Tee"
payload.result[].{name: name, price: sellingPrice} [{"name": "Cotton Tee", "price": 899}, …]
payload.result[?sellingPrice < `500`].name ["Denim Cap"]

Several Things at Once

The { ... } form selects any number of fields, from anywhere in the response, and lets you rename them as you go:

{
  products: payload.result[].{name: name, price: sellingPrice, image: mainImage},
  total: payload.total,
  currency: configs.currency
}

Renaming is worth doing. price reads more clearly to the agent than sellingPrice, and short names cost fewer tokens.

Good to Know

  • Nothing matched? The agent receives the full, unfiltered response. This is deliberate — an empty result would lead the agent to tell your customer the data does not exist. So if filtering appears to do nothing, the expression almost certainly does not match the API's real shape.
  • [] means "every item in this list". Without it, payload.result.name looks for a field called name on the list itself, and finds nothing.
  • The expression is checked as you type. A red field means it cannot be parsed, and the tool will not save until it is fixed.
  • Leaving the toggle off sends the whole response, exactly as before.

Supported Request Types

Request Type Use Case
GET Fetch data (e.g., weather, user info)
POST Submit data (e.g., create order)

Use Cases for a Sales AI Agent

  • Product Catalog Lookup:
    Fetch detailed product specs, pricing tiers, and availability in real time when customers ask about features or stock.

  • Pricing & Quotations:
    Generate customized quotes by pulling pricing rules, discounts, and tax rates, then return a formatted proposal.

  • Inventory Checks:
    Verify item availability across warehouses or stores before committing to orders or deliveries.

  • Order Creation & Tracking:
    Place orders on behalf of customers and retrieve shipment status updates to keep prospects informed.

  • Upsell & Cross‑sell Suggestions:
    Call recommendation engines to surface complementary products based on customer interests or purchase history.

By configuring the API Tool with these sales‑focused endpoints, your TailorTalk agent can drive more effective, personalized engagements, streamlining everything from discovery to close.

XLinkedIn