Macha

How Do You Build a Custom API Tool for an AI Agent? A Practical Guide

Abbas, Customer Support & AI, Macha

Written by

Ankeet Guha, Co-founder & CTO, Macha

Reviewed by

Published May 11, 2026

Updated September 24, 2026

A custom API tool lets an AI agent call any REST endpoint mid-conversation, such as an order system, a shipping tracker or an internal CRM. You define the URL, method, authentication and parameters once, test the tool, and assign it to the agents that need it.

Key takeaways

  • A Macha custom API tool is defined by a label and description, an HTTP method and URL with placeholders, an authentication type, parameters and an optional response mapping.
  • Macha custom tools support four authentication types: none, an API key in a custom header, a bearer token, or basic auth, with credentials encrypted at rest.
  • The tool editor's Test button sends a real request with sample values, which catches auth errors, wrong URLs and malformed body templates before an agent uses the tool.
  • Response mapping takes a dot path such as data.results, so the agent sees only the array it needs instead of the full nested API response.
  • A WISMO agent on Zendesk can chain four tools: Get Ticket, Get Ticket Custom Fields, a custom shipping status tool, and Add Internal Note.
How Do You Build a Custom API Tool for an AI Agent? A Practical Guide

To give a Macha AI agent a custom API tool, you define five things once: a label and description, an HTTP method and URL with {{param}} placeholders, an authentication type (none, API key, bearer token or basic auth), the parameters the agent fills in, and an optional response mapping. The agent then calls that endpoint mid-conversation and uses what comes back in its reply. No code is required, and custom API tools are included on every Macha plan (pricing).

SettingWhat you enter
Label and descriptionWhat the tool does and when to call it
TypeRead (fetches data) or Write (creates, updates or deletes)
Method and URLGET, POST, PUT, PATCH or DELETE; placeholders in double curly braces
AuthenticationNone, API key (custom header), bearer token or basic auth
ParametersName, type, description and required flag for each placeholder
Body templateJSON with placeholders, for POST, PUT and PATCH
Response mappingA dot path, such as data.results, that trims the response

What is a custom API tool?

A custom API tool is an HTTP endpoint your AI agent can call during a conversation. You create it once for the organization and assign it to any agent that needs it.

You're teaching the agent one rule: "when you need shipping status, call this URL with the order number, and here's what the response means." Credentials are encrypted at rest and never shown to the AI model. Write tools ask for user confirmation before they run in chat.

If you'd rather not fill in the form yourself, the AI Tool Builder (in Macha Experiment Labs) and Sidekick can build the tool from a description: you name the API, paste a credential and a test ID, and it proposes the endpoints, tests them and creates the tools.

What does a shipping status tool look like?

  • Method: GET
  • URL: https://www.example.com/api/order/{{order_number}}/shipping-status
  • Auth: none (public tracking endpoint)
  • Parameter: order_number (string, required): "The 12-digit order number including leading zeros"

When the agent needs an order's status, it takes the order number from the ticket or a custom field, calls the URL, and gets back the carrier, tracking events and delivery date.

How do you make a custom tool reliable?

  • Write descriptive labels. Include the service and resource: "Shop: Get Order Shipping Status", not "Get Status". The agent picks between tools by label when several are assigned.
  • State the parameter format. "12-digit number starting with 01, preserve leading zeros."
  • Test before you assign. The tool editor's Test button sends a real request with sample values, so you catch auth errors, wrong URLs and malformed body templates before an agent does.
  • Use response mapping. If the API wraps its data, set the dot path (for example data.results or order) so the agent sees only the part it needs.

How do custom tools combine with help desk tools?

Custom tools sit next to the built-in connector tools on an agent's Tools tab, and an agent can only use tools assigned to it. A WISMO agent on Zendesk might use:

  1. Get Ticket (Zendesk): read the customer's message
  2. Get Ticket Custom Fields (Zendesk): pull the order number from a ticket field
  3. Get Shipping Status (custom tool): call the shop's API with that number
  4. Add Internal Note (Zendesk): post the drafted reply for human review

Four tools, one agent, and no one copies an order number between tabs. The same pattern works on Zendesk, Freshdesk, Gorgias, Front, HubSpot or Intercom. The full field reference is in the custom tools docs.

Macha

About Macha

Macha is an AI agent platform that works on top of the help desk you already use — Zendesk, Freshdesk, Gorgias, or Front — and connects to the rest of your stack, even your own internal systems. Its AI agents resolve tickets and automate entire workflows end to end, all set up in plain English, no code. Learn more about Macha →

Zendesk
5.0 on Zendesk Marketplace

Loved by support teams worldwide

See what support teams are saying about Macha AI.

The application seems excellent to me! We are still testing, and we need support for some details and they were extremely efficient too!

Daniela Costa

Daniela Costa

Head of Support, Seabra

Macha has been a great addition to our support toolkit. It generates clear, well-organized responses that fit naturally into our workflow. One feature we particularly appreciate is its ability to automatically reply in the same language as the ticket.

Marius F

Marius F

Support Head, Zentana

We've been using Macha for a little while now and it's been really great addition so far! It's powerful, convenient, and makes getting work done a lot easier for our agents.

Alexander Wedén

Alexander Wedén

Head of Support

Support team is very helpful and responsive. Really enjoy how lightweight this is within Zendesk itself vs other more intrusive tools.

Cathleen Wright

Cathleen Wright

Zendesk Admin, Cortex IO

So far it's pretty good! Our queries are a little nuanced, so we can't always use it, but it's got enough utility for us. It can even incorporate our bilingual country with greetings in a second language.

Jae Oliver

Jae Oliver

Head of Support, Wise

Really enjoying using Macha, it has made a noticeable difference to our support team in a short amount of time. I really like the ticket summary feature, saves us a lot of time.

Harry Jackson

Harry Jackson

Head of Support, Crumb

Macha AI is a great addition to my workspace! It's powerful, convenient, and it really makes productivity so much easier for our agents!

Dave G

Dave G

Head of Support, Cyber Power Systems

Very impressed! AI integration for Zendesk has certainly come a long way and Macha seems to set the standard for now. This will for sure save lot of time in our support team.

Pauli Juel

Pauli Juel

Head of CS, Dokument24

Macha has been working great for us so far! The auto-responses are accurate and our resolution time has dropped significantly.

Lana T

Lana T

Zendesk Admin, Swotzy

Macha AI is a great addition. The knowledge base feature means our agents always have the right answers at their fingertips.

Mischa Wolf

Mischa Wolf

Head of Support, Topi

We're enjoying this integration so far. It's made our support team more efficient and our customers get faster responses.

Paula G

Paula G

Head of Customer Support, Xly Studio

The team enjoys using it. It saves considerable time on common questions and the integration options are excellent.

Kilian Leister

Kilian Leister

Support Head, Didriksons

Ready to supercharge your team with AI?

Get started in minutes. Connect your tools, configure your agents, and let AI handle the rest.

$50 in free credits · no time limit, no credit card