MonCha
Skip to article

Functions

Search MonCha documentation

Search the full guides for topics such as renewal, ticket alerts, OAuth or knowledge refresh.

Let the bot do things, not just say things. It calls your API mid-conversation and answers with live data.

On this page

Availability follows the Functions entitlement shown in API & Agents. Current Growth and Scale plans include API access; enterprise and sponsored bots depend on their active contract and bot entitlement.

What a function is

A function is one of your HTTP endpoints, described in plain language. When a customer asks something that needs live data — “where's my order ORD-12345?” — the bot decides to call it, extracts the parameters from the conversation, hits your API, and answers with what it gets back.

Setting one up

Go to API & Agents → Functions and provide:

  • Name — get_order_status. Lowercase, underscores.
  • When should the bot use it? — the description the model reads to decide. Be specific; this is the most important field.
  • Method & URL — GET sends parameters as a query string, POST as a JSON body. HTTPS only.
  • Parameters — one per line, name: what it means. Each declared parameter is required and passed as a string.
  • Request headers (optional) — one per line, name: value, for example Authorization: Bearer …. Use this when your endpoint requires authentication.

Choose all bots or one eligible bot when creating the function. Use a specific bot when an endpoint belongs to only one brand or service. Sponsored bots must have the required live entitlement.

Name:        get_order_status
Description: Look up the current shipping status and expected delivery
             date of a customer's order using their order number
Method:      GET
URL:         https://api.yourshop.com/orders/status
Parameters:  order_id: the customer's order number, e.g. ORD-12345

What your endpoint receives

For the example above, the bot calls:

GET https://api.yourshop.com/orders/status?order_id=ORD-12345

Return JSON. The bot reads it and phrases the answer for the customer, in their language:

{"order_id":"ORD-12345","status":"shipped",
 "courier":"BlueDart","expected_delivery":"July 13, 2026"}

→ "Your order ORD-12345 has shipped with BlueDart and should
   arrive by July 13, 2026."

Writing good descriptions

The model only calls a function when the description convinces it this is the right tool. Vague descriptions cause missed calls and wrong calls.

  • “Check whether a specific product size is currently in stock at a given store branch”
  • “Product API”

Security

  • Endpoints must be HTTPS and publicly reachable. Private and internal addresses and redirects are rejected.
  • Pass auth with custom headers — they're stored with the function and never exposed to the visitor.
  • Responses are truncated to 4,000 characters and time out after 10 seconds.
  • The model uses the returned content to answer the visitor. Return only information that visitor is authorized to receive; do not include secrets in the response.
  • Treat every parameter as untrusted input. Authorize on your side.

Limits

Up to 10 functions per account. If the bot gets confused it stops after three tool rounds and tells the customer it couldn't complete the lookup, rather than looping.

Functions let the bot pull from your systems. To push events out to your systems, see Webhooks.

Related guides

Something unclear? Tell us.

Start free trial