A practical field guide from Automation Ace.
Short answer: to turn third-party API actions into AI agent tools, start from the tasks the agent must do and pick the few API actions they need, then wrap each action in a tool with a clear verb-object name, a description that says when to use it, a small input schema, and a trimmed, predictable output. Keep authentication and account selection in your code (or a managed layer such as Make Endpoints, which exports ready-made tool definitions), return plain-language errors, add idempotency and approvals for writes, and test the tools with the model before shipping.
Short answer
- List tasks, then choose the minimum actions.
- Name, describe, and schema each tool.
- Inject auth, account, and IDs in code.
- Return small outputs and clear errors.
- Idempotency keys and approvals for writes.
- Evaluate with real prompts; iterate on descriptions.
Why raw APIs make bad tools
APIs are designed for programmers who read documentation: dozens of endpoints, optional parameters, pagination, and large responses. A model choosing tools at run time does better with a handful of focused tools that each do one job. Concepts: how AI agents use tools, APIs, and MCP.
Step 1: Pick the actions from real tasks
- Write 10 to 20 real requests the agent should handle.
- List the API actions each one needs; most agents need 3 to 10 tools, not 100.
- Prefer combined actions (“find or create contact”) when the agent would always call two in sequence.
Scope down: limiting AI agent app actions.
Step 2: Design the tool contract
| Part | What to write | Example |
|---|---|---|
| Name | Verb plus object, unique | crm_find_contact |
| Description | When to use it, when not to, what it returns | “Find one contact by email. Use before creating a contact. Returns id, name, owner, or null.” |
| Input schema | Few required fields, enums, formats | email (string, format email) |
| Hidden parameters | Set by your code, never the model | Account or connection ID, workspace, API base URL |
| Output | Small, predictable JSON | { id, name, owner } instead of the full API response |
| Errors | Plain messages the model can act on | “No contact found” vs a raw 404 body |
// A hand-written tool around one API action (provider-neutral sketch)
const findContact = {
name: 'crm_find_contact',
description:
'Find one CRM contact by email. Use this before creating a contact to avoid ' +
'duplicates. Returns { id, name, owner } or null if not found.',
input_schema: {
type: 'object',
properties: { email: { type: 'string', format: 'email' } },
required: ['email'],
additionalProperties: false,
},
async run({ email }, ctx) {
// ctx comes from your code: user, connection, idempotency key, logger
const res = await crmApi.searchContacts({ email }, { auth: ctx.connection });
const c = res.results[0];
return c ? { id: c.id, name: c.fullName, owner: c.ownerName } : null;
},
};
Step 3: Hide auth and account choice
- The model should never see or choose tokens, connection IDs, or which customer's account to use.
- Resolve them from the signed-in user or the tool's configuration.
- Use a managed auth layer so tokens never reach your agent code; see API authentication for AI agents with Make Endpoints and managed app auth platforms.
Step 4: Shape outputs and errors
- Return only fields the model needs; large outputs waste tokens and confuse the model.
- Normalize dates, money, and IDs.
- Translate errors: “Rate limited, try again in 30 seconds” beats a raw 429 body (429 errors).
- Treat output as data; text from third-party systems can contain instructions the model should ignore.
Step 5: Make writes safe
- Pass an idempotency key so a retried call doesn't create duplicates (Make Endpoints supports this natively).
- Require approval for sends, deletes, refunds, and bulk changes; see permissions, approvals, and audit trails.
- Log every call with inputs (redacted), result, and who it acted for.
Step 6: Test with the model
- Run your real requests and check the model picks the right tool with the right inputs.
- Fix wrong picks by improving descriptions, not by adding more tools.
- Retest after API or SDK upgrades.
Where tools come from
| Source of tools | Effort | Notes |
|---|---|---|
| Hand-written wrappers around an API | Highest | Full control; you own auth and maintenance |
| Generated from an OpenAPI spec | Medium | Fast, but descriptions and outputs usually need editing |
| Make Endpoints tool definitions | Low | Typed tools for app actions; Make holds credentials (closed beta at the time of writing) |
| Existing MCP servers (Zapier MCP, app vendors) | Lowest | Connect and choose actions; less control over shape |
| Your own automation workflows as tools | Low to medium | Expose a scenario, Zap, or workflow as one tool for multi-step jobs |
// Generated tools: Make Endpoints exports every endpoint as a tool definition
import { EndpointTools } from '@makehq/endpoints-sdk/tools';
const allow = ['google-docs_get-document']; // curate, don't dump
const tools = EndpointTools.filter((t) => allow.includes(t.name));
// Each tool has a name, a definition with an inputSchema, and execute(make, args).
// Your runner adds teamId and connectionId before calling execute().
Full walkthrough: building AI agents with the Make Endpoints SDK. Delivery method: Make Endpoints vs MCP.
Frequently asked questions
How do I turn an API into an AI agent tool?
Pick the specific API actions the agent’s tasks need, wrap each in a tool with a clear name, a description of when to use it, a small input schema, and a trimmed output, keep authentication in your code, and test the tools with real prompts.
How many tools should an AI agent have?
As few as the tasks require, often 3 to 10. Fewer, well-described tools lead to more reliable tool selection than exposing a whole API.
Should the AI model handle API keys or OAuth tokens?
No. Keep credentials, connection IDs, and account selection in your code or a managed auth layer so the model never sees or chooses them.
Can I generate agent tools automatically?
Yes. You can generate tools from OpenAPI specs, use Make Endpoints tool definitions, or connect existing MCP servers. Review names, descriptions, and outputs before giving them to an agent.
How do I prevent duplicate actions from agent tools?
Pass an idempotency key with write calls, search before creating, and require approval for high-impact actions such as sends, deletes, and refunds.
Disclaimer: Make Endpoints was in closed beta at the time of writing; available apps, endpoints, SDK methods, scopes, and pricing can change between releases, so pin versions and test before relying on them in production; details reflect public documentation and coverage at the time of writing, so confirm current details with each provider before building. Automation Ace is not affiliated with Make beyond the referral links marked on this page. This article may include links to apps, products, or services; some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.