> ## Documentation Index
> Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample query walkthrough

The following sections trace one user question through the full agent execution cycle: skill match, instruction load, tool call, script runs, reference read, and final answer. Each step shows exactly what loads and when.

## Sample utterance

> "Is Gadget Max running low? Do we need to reorder?"

## Step 1 Skill matching

The agent holds two skills: `order-placement` and `inventory-check`. It compares each skill's `description` field against the utterance.

```yaml theme={null}
name: inventory-check
description: Check inventory levels and stock health for a product. Use when a user
  asks whether a product is in stock, needs reordering, or wants days-of-supply metrics.
allowed-tools: check_inventory
```

The utterance contains "running low" and "reorder", which matches `inventory-check`, not `order-placement`. The agent loads only this skill's full instructions into context. Tool access narrows to `allowed-tools: check_inventory` plus any agent-level tools (`get_customer_profile`).

## Step 2 Instruction load

The full `inventory-check` `SKILL.md` body enters context. The first instruction reads:

```
Call check_inventory(product_id=<id>) to get the current stock level and average daily demand.
```

The agent resolves "Gadget Max" to `SKU-002` through catalog lookup, then calls the tool.

## Step 3 Tool call

```json theme={null}
check_inventory(product_id="SKU-002")
```

The tool returns:

| Field           | Value        |
| --------------- | ------------ |
| `found`         | `true`       |
| `name`          | `Gadget Max` |
| `current_stock` | `5`          |
| `daily_demand`  | `8.5`        |

## Step 4 Script run check\_stock.py

The skill instructions say to run `check_stock.py` with the retrieved values:

```python theme={null}
run(product_id="SKU-002", current_stock=5, daily_demand=8.5)
```

The script computes:

```python theme={null}
days_of_supply = 5 / 8.5   # 0.6
status = "critical"         # days_of_supply < 3
reorder_needed = True       # days_of_supply < 14
```

The script returns:

| Field            | Value      |
| ---------------- | ---------- |
| `status`         | `critical` |
| `days_of_supply` | `0.6`      |
| `reorder_needed` | `true`     |

## Step 5 Reference read INVENTORY\_GUIDE.md

The skill instructions send the agent to `INVENTORY_GUIDE.md` for threshold definitions and escalation rules. The file is not preloaded, it fetches now because the `critical` status needs to interpret.

The guide confirms:

```
critical — < 3 days | Near-zero; risk of stockout within hours
```

The escalation table adds the required action:

```
critical → Alert supply chain team; request expedited shipment
```

The guide also points to a second script for the reorder calculation.

## Step 6 Script run calc\_reorder.py

Because `reorder_needed` is `true`, the guide instructs the agent to run `calc_reorder.py`:

```python theme={null}
run(product_id="SKU-002", daily_demand=8.5, lead_time_days=7, safety_days=3)
```

The script computes:

```python theme={null}
safety_stock  = 8.5 * 3        # 25.5 -> 26
reorder_point = 8.5 * 7 + 25.5 # 85
reorder_qty   = 85 * 2         # 170
```

The script returns:

| Field           | Value |
| --------------- | ----- |
| `reorder_point` | `85`  |
| `reorder_qty`   | `170` |
| `safety_stock`  | `26`  |

## Final answer

The agent combines the tool output, both script results, and the guide's escalation line into one reply:

> Gadget Max (SKU-002) is critical, 0.6 days of supply left (5 units at 8.5 per day demand). Recommend ordering **170 units** now (reorder point 85, safety stock 26). Per policy, alert the supply chain team and request an expedited shipment.

## What loaded and in what order

| Step | Source                                   | Reason                                        |
| ---- | ---------------------------------------- | --------------------------------------------- |
| 1    | `inventory-check` `SKILL.md` description | Skill match against utterance                 |
| 2    | `inventory-check` `SKILL.md` body        | Full instructions for the matched skill       |
| 3    | `check_inventory` tool                   | Fetch current stock data                      |
| 4    | `check_stock.py`                         | Compute status and days of supply             |
| 5    | `INVENTORY_GUIDE.md`                     | Look up threshold meaning and escalation rule |
| 6    | `calc_reorder.py`                        | Compute reorder quantity                      |

Nothing from `order-placement` loads. That skill's `SKILL.md`, scripts, and reference all stay out of context because the utterance does not match its description.

## Tool visibility during execution

While `inventory-check` runs, the agent's available tool set is `check_inventory` (from `allowed-tools`) plus the agent-level tool `get_customer_profile`. The `order-placement` tools `create_order` and `update_order_status` are not visible or callable at any point in this run. The model cannot see them, cannot call them, and has no knowledge of them. Each skill sees only its own `allowed-tools` plus agent-level tools, never another skill's.

## Next steps

* See [Inventory check skill](/agent_skills/multi/inventory_check) for the full skill definition, both scripts, and the inventory guide reference.
* See [Order placement skill](/agent_skills/multi/order_placement) to compare how a different utterance activates the other skill.
* See [Operations assistant](/agent_skills/multi/agent) for the agent configuration that holds both skills.
