DocsTools & MCPCustom REST APIs & MCP
Build custom REST API tools, interpolate dynamic variables, and bind MCP servers

Custom REST APIs & MCP

Give your voice agents real-time capabilities to query databases, trigger webhooks, book appointments, and connect to Model Context Protocol (MCP) servers.

Open Tools Studio →


Overview

Tools empower your voice assistants to perform actions during live calls. When a caller asks a question requiring external data (e.g. "What is the status of order #9482?"), the LLM detects the intent, executes the tool, receives the JSON response, and speaks the answer naturally.

Tools ListingTools Listing

Tunk supports two types of tool integrations:

  1. Custom REST API Tool: Directly call your existing HTTP endpoints (GET, POST, PUT, PATCH, DELETE).
  2. Model Context Protocol (MCP) Server: Connect standardized MCP servers over SSE or stdio transports.

Choose Tool ArchitectureChoose Tool Architecture


Creating a Custom REST API Tool

Click Create New Tool and choose Custom Tool. Complete the 3-step configuration:

Step 1: Tool Profile

  • Tool Name: Unique snake_case identifier (e.g. check_order_status).
  • Tool Description: Critical instructions explaining to the LLM when and why this tool should be called.
    Plain text
    Call this tool when the customer provides their order ID to retrieve current shipping status, tracking number, and estimated delivery date.

Tool Profile SetupTool Profile Setup


Step 2: Variables (Input Schema)

Define the arguments the LLM must extract from the customer's speech before invoking the tool:

  • Variable Name: e.g. order_id
  • Data Type: string, number, boolean
  • Description: Guide the LLM on extraction constraints (e.g. "A 6-digit alphanumeric code like ORD123").

Tool Variables SetupTool Variables Setup


Step 3: API Config & Testing

Point the tool at your backend server and define the request template:

  • HTTP Method: GET, POST, PUT, PATCH, or DELETE.
  • Request URL: Supports dynamic variable interpolation in the path or query string:
    Plain text
    https://api.yourcompany.com/v1/orders/{order_id}
  • HTTP Headers: Add authorization headers or API keys:
    Plain text
    Authorization: Bearer YOUR_INTERNAL_SECRET
    Content-Type: application/json
  • Request Body (JSON Template): Format the body payload with interpolated {variables}:
    JSON
    {
      "order_id": "{order_id}",
      "source": "tunk_voice_call"
    }
  • Live Test Runner: Use the built-in test drawer to enter mock values for {order_id} and click Test Endpoint to inspect the live response status and JSON payload immediately.

Tool API Config SetupTool API Config Setup


Model Context Protocol (MCP) Configuration

Tunk provides native support for Anthropic's Model Context Protocol (MCP), allowing you to connect remote MCP server tools seamlessly:

  1. In the creation modal, choose MCP Server.
  2. Server URL: Your hosted MCP endpoint (e.g. https://mcp.yourcompany.com/sse).
  3. Connection Timeout: Set maximum connection negotiation time in seconds.
  4. Server Authentication: Configure Bearer tokens or custom credentials.
  5. Once connected, all tools exposed by the MCP server become automatically selectable.

MCP Server ConfigurationMCP Server Configuration


Linking Tools to Assistants

To equip an assistant with your custom tool:

  1. Open Assistant Studio and select your assistant.
  2. Navigate to the Resources tab.
  3. Check the box next to your tool in the Tools section.
  4. Click Save Config. The assistant can now invoke the tool during live calls!
Need help? Reach out on our support portal.