Turn your function into a tool an agent can call
Below is a shipping-cost function you already wrote — it works. But an agent never sees your code. All it sees is the tool’s name and description. Make them vague and the agent guesses the price (and can’t know your rate table); make them clear and the same function gets called and the figure is exact. Same code, different metadata, opposite outcome — then save it as a tool a chat can use.
Nothing here says shipping or cost — the model can't tell this is what it needs, so it guesses.
How much will it cost to ship a 7 kg parcel to Japan?
true cost (your function): $132
Pick a description, then ask the agent.
No code, no formula, no rate table — just these three fields decide whether the agent reaches for it.
Saving registers this as an artifact a chat agent can call — the bridge into the composition core.