Let the assistant act in your app
Give your Masheev assistant typed tools it can call during a conversation. They run in your app, can return a card or quick replies, and can wait for the person to approve. Client tools run in website chat.
From $18/month for your whole team after the trial. Card required. No charge if you cancel within 14 days. Available to businesses in the UK and US.
What are AI agent tools (function calling)?
Tools are functions you give the assistant so it can act as well as answer. During a conversation it decides when a tool is needed, calls it with validated arguments and uses the result to continue: looking up an order, booking a slot or updating a record.
In Masheev you define client tools with the clientTool helper, typed with Zod or JSON Schema. Their execute function runs in your app and can return text, a card or quick replies, with optional approval for sensitive actions. The agent can also use server-side actions and connected integrations on the backend.
Three blocks of code. That’s a tool.
import { clientTool, useMasheev } from "@masheev/embed-sdk/react"; import { z } from "zod"; const checkOrder = clientTool({ name: "check_order_status", description: "Look up the status of a customer's order", parameters: z.object({ orderId: z.string() }), needsApproval: false,Typed with Zod or JSON Schema
Define a tool’s name, description and parameters with Zod or plain JSON Schema. The assistant calls it with validated arguments.
execute: async ({ orderId }) => { const order = await myApi.getOrder(orderId); return { success: true, display: "card", components: { card: { title: `Order ${order.id}`, fields: [{ label: "Status", value: order.status }], }, }, }; }, });Runs in your app
Your execute function runs in the browser. It can call your API, look up a record or book a slot, then return the result to the conversation.
// Pass tools to the assistant useMasheev({ inboxId: "inb_123", tools: [checkOrder] });Hand it to the assistant
Pass your tools to useMasheev, or update them during a session. The assistant calls them when they are relevant.
Ask first.
- I want to return this.
- I’ll start a return for order 1042. Confirm?
- execute() runs only after the customer confirms.
- Approval before it runs
- Set needsApproval on a tool and the person confirms before it runs. Use it for anything that changes data or costs money.
- Results are data, not instructions
- Tool results are sanitized and passed to the model as data, with size and rate limits, which guards against prompt injection.
Illustrative example
What else a tool can do.
Returns cards and quick replies
A result can appear as text, a structured card or quick-reply buttons, so people see the order or booking itself rather than a paragraph about it.
Server-side actions
Alongside client tools, the agent can use server-side actions and connected integrations, such as calendars, from the backend.
Connecting your own APIs from the server, and tools outside website chat.
Your app does the work.
Frequently asked questions
What are AI agent tools?
Tools, also called function calling, are functions you give the assistant so it can act as well as answer. During a conversation it decides when to call a tool, sends validated arguments and uses the result to continue. In Masheev, client tools run in your app and server-side actions run on the backend.
How do I define a tool?
Use the clientTool helper with a name, a description and a parameters schema (Zod or JSON Schema), plus an execute function that does the work and returns a result. Pass your tools to useMasheev, or update them during a session. The assistant calls them when they are relevant.
Can a tool require approval before running?
Yes. Set needsApproval on the tool and the person must confirm before your execute function runs. Use it for actions that change data, place orders or cost money.
Can tools show rich UI, not just text?
Yes. A tool result can be shown as plain text, a structured card (title, subtitle and labelled fields) or quick-reply buttons inside the conversation.
How are tools kept secure?
Tool results are sanitized and treated strictly as data, not as instructions to the model, which defends against prompt injection. Returned data has size limits, calls are rate limited, and sensitive actions can require approval.
Give the assistant something to do
Define typed tools, decide which ones need approval, and let the assistant handle the lookups and bookings.
From $18/month for your whole team after the trial. Card required. No charge if you cancel within 14 days. Available to businesses in the UK and US.