Connect your first system
In about 30 minutes you will connect an API, give its tools to a specialist agent, and watch the agent complete a customer’s request with them, from finding a product to placing the order.
You need: an account with a sandbox (see Your first conversation). Takes: about 30 minutes.
The example is Kaya Fashion, a UK online clothing store. Its agent searches the catalogue, answers questions about a product, looks up an order and places a new one. It runs on DummyJSON, a free public test API, so every step works without an API of your own. Swap in your own API as you go.
Download the two finished files to follow along:
- kaya-shop-openapi.yaml: the API’s description
- kaya-shop-manifest.yaml: the manifest
1. Choose the operations
Section titled “1. Choose the operations”Start from the questions customers ask, not from the API’s reference. For each question, find the one call that answers it.
| Customer question | Operation | Changes data? |
|---|---|---|
| “Do you have an evening gown?” | GET /products/search |
No |
| “What shoes do you have?” | GET /products/category/{category} |
No |
| “How much is it, and can I return it?” | GET /products/{id} |
No |
| “Where’s my order 12?” | GET /carts/{id} |
No |
| “Please order it.” | POST /carts/add |
Yes |
| “When are you open?” | none: put it in the instructions |
Aim for 3 to 8 tools. More than 10 gets a warning, and more than 20 is refused.
2. Prepare the OpenAPI file
Section titled “2. Prepare the OpenAPI file”Keep only the operations you chose. Then tighten them, because the agent builds its arguments from these types.
- Give every operation an
operationId. The manifest refers to it. - Give every parameter a
type. A parameter without one is refused. - Limit every text parameter with an
enum,pattern,formatormaxLength. An open one gets a warning. - Write a
descriptionfor each parameter. The agent reads it.
Kaya limits its categories to the clothing ones, so the agent can’t browse furniture:
- name: category in: path required: true schema: type: string enum: [tops, womens-dresses, womens-shoes, womens-bags, womens-jewellery, womens-watches, mens-shirts, mens-shoes, mens-watches, sunglasses]Response schemas are optional. What the agent gets back is set in the manifest, in step 4.
3. Write the connection
Section titled “3. Write the connection”The top of the manifest says where calls go and how they’re authenticated:
api_target: name: kaya-shop version_label: v1 spec: format: openapi-3.x file: kaya-shop-openapi.yaml base_url: https://dummyjson.com auth: scheme: api_key in: header name: X-Api-Key credential_ref: secret:kaya_shop_key defaults: timeout_ms: { connect: 2000, read: 8000 } rate_limit: 30/mincredential_refnames the key; it never holds it. You set the value in step 6.defaults.timeout_msis required.base_urlmust be a public address.
4. Describe each tool
Section titled “4. Describe each tool”Each entry under operations becomes one tool. Here is the product lookup:
operations: - operation_id: getProduct tool_name: kaya_get_product description: > Get one product's full details by id: description, price, discount, stock, shipping time, return policy and warranty. Use after a search when the customer asks about a specific item, and always before placing an order for it. side_effect: false policy: rate_limit: 20/session projection: success: fields: [id, title, description, price, discountPercentage, stock, availabilityStatus, shippingInformation, returnPolicy, warrantyInformation]tool_name: lowercase words joined by underscores, at least two of them.description: the agent chooses tools by reading this. Say when to use the tool, not just what it does. At least 40 characters.projection: the fields the agent sees. Without it, the agent gets the whole response. DummyJSON’s products include reviewer emails and barcodes, and Kaya’s agent sees none of them.products[].titletakes a field from every item in a list.policy.rate_limit: how often the tool can be called, here per conversation. Tendus adds it to the description for you.
Placing an order changes data, so it says so and declares how a repeat is recognised:
- operation_id: createOrder tool_name: kaya_create_order description: > Place an order for one or more products. Only call this after the customer has confirmed the exact products and quantities in this conversation. Never call it to check a price or stock level; use kaya_get_product for that. side_effect: true idempotency: style: header name: Idempotency-Key policy: rate_limit: 2/session argument_constraints: userId: { enum: [1] }side_effect: trueon anything that would do something twice if called twice. Tendus doesn’t retry these calls itself, and marks them “changes data” everywhere. To have the customer tap Confirm before one runs, addconfirmation.argument_constraintsnarrows what the agent may send. The test API pins every order to its demo customer. Your own API should take the customer from its own sign-in, never from an argument the agent fills in.
5. Upload it as a draft
Section titled “5. Upload it as a draft”- Check you are in your sandbox: a striped band runs across the top of the console.
- Open Agent → Tools & APIs and select Upload manifest.
- Choose both files and select Upload as draft.
If the upload is refused, each problem names its file and line, and says what to fix. Fix them and upload again.
6. Set the key
Section titled “6. Set the key”- Open Settings → Credentials.
- Find
kaya_shop_keyunder Needed, not set yet and select Add. - Enter any value, such as
demo. DummyJSON doesn’t check keys; your own API will.
7. Review and activate
Section titled “7. Review and activate”- On Agent → Tools & APIs, select Review on the
kaya-shopcard. - Read what changes and the tools in the draft.
- Select Activate v1 and confirm. The sandbox’s agent can use the tools from its next reply. Live is not affected.
8. Give the tools to a specialist agent
Section titled “8. Give the tools to a specialist agent”- Open Agent and select New specialist.
- Select Suggest from tools after picking the five
kaya_tools, or fill in the fields yourself:- Name:
shop - Routing description: “Handles Kaya Fashion’s products and orders: finding items, checking price, stock, shipping and return policy, looking up an order by number, and placing an order. Not for opening hours, delivery areas or speaking to a person.”
- Instructions: “Only state prices, stock and order details that a tool result gave you. Never place an order until the customer has confirmed the exact items and quantities.”
- Name:
- Select Save specialist.
See Specialist agents for what each field does.
9. Test it
Section titled “9. Test it”- Select Test your agent and ask: “Do you have an evening gown?”
- Then ask: “Can I return it?”
- Then ask it to order one. It should confirm the item and quantity first, then place the order with
kaya_create_order. - Open Conversations and select your chat. Under each reply, select a tool call to see what was sent and what came back.
Check it worked: the first reply names the Black Women’s Gown, from a kaya_search_products
lookup with the outcome ok. The second says it has no return policy, from kaya_get_product. After you confirm, the order is
placed by kaya_create_order, marked “changes data”, and the agent should report the order number from
its result.
An ok tool call can still find nothing. Search for “black dress” and the test API returns no products,
because it matches the whole phrase: the outcome is ok and the result is empty. That’s why the search
tool’s description says to search on the key word. Testing with real questions is how you find
quirks like this in your own API.
The test API isn’t a real shop. Its orders mix in other kinds of items, and new orders aren’t stored.
Next: when the sandbox behaves the way you want, release it to Live.