YourGPT Helpdesk

Find answers to your questions

Setting Up API Functions with Tool Params in YourGPT

Create dynamic Functions with Tool Params for API calls, variable mapping, and real-world use cases

YourGPT Functions enable powerful, modular logic to be executed within chat conversations. One of the most versatile types is the API Function, which allows you to connect external APIs to natural language prompts — making your assistant dynamic, data-driven, and action-capable.

When users make requests, YourGPT automatically extracts key parameters from their input using AI. These are referred to as Tool Params, and they’re mapped into API endpoints to generate context-aware responses.

Whether you want to recommend products, create support tickets, fetch CRM data, or optimize pricing, API Functions let you build reusable workflows that respond to real-world inputs instantly.


📘 Overview: Creating a API Function with Tool Params

  1. Go to Function in Dashboard.

  2. Click on Add API Function.

    Creating API Function
  3. Set the Function Name and Description.

  4. Define Tool Params by creating Parameter Variables.

  5. Add Variable name with Tool Params - {{Tool_Params.Variable_Name}}

  6. Click on Add Function to Save to function.

    Adding tool params.

Let’s look at several real-world use cases demonstrating how Tool Params can be applied to dynamic Functions.


Use Case 1: Post Fetching

When the user asked to get the particular post with its post ID.

User Input: "Show me the post with post ID 5"

API Configuration

Endpointhttps://jsonplaceholder.typicode.com/posts

Method: GET

Function NamegetPost

URL Structure:

https://jsonplaceholder.typicode.com/posts/{{Tool_Params.post_id}}

Tool Params Mapping

Variable

Value

Description

post_id

5

The unique id of post

Get Request

Expected Response

{
  "userId": 1,
  "id": 5,
  "title": "YourGPT",
  "body": "This is the post body"
}

Use Case 2: Searching Users

Description

When the user is asked to search for a user with their first and last name.

User Input: "Check if this user exists whose first name is John and last name is Doe"

API Configuration

Endpoint: https://jsonplaceholder.typicode.com/users

Method: Get

Function Name: searchUser

URL Structure

https://jsonplaceholder.typicode.com/users?name={{Tool_Params.first_name}}%20{{Tool_Params.last_name}}

Expected Response

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "username": "Bret",
    "email": "[email protected]",
    "address": {
      "street": "Kulas Light",
      "suite": "Apt. 556",
      "city": "Gwenborough",
      "zipcode": "92998-3874",
      "geo": {
        "lat": "-37.3159",
        "lng": "81.1496"
      }
    },
    "phone": "1-770-736-8031 x56442",
    "website": "hildegard.org",
    "company": {
      "name": "Romaguera-Crona",
      "catchPhrase": "Multi-layered client-server neural-net",
      "bs": "harness real-time e-markets"
    }
  }
]

Use Case 3: Creating Post

Description

When the user is asked to create the post with userId, title, and body.

User Input: "Create a post titled YourGPT Docs, with userId 11 and body: This is sample body data."

API Configuration

Endpointhttps://jsonplaceholder.typicode.com/posts

Method: POST

Function NamecreatePost

URL Structure

https://jsonplaceholder.typicode.com/posts

Tool Params Mapping

Variable

Value

Description

userId

11

Id of the user

title

YourGPT docs

Title for the post

body

The sample body of post

Description of the post.

Expected Response

{
  "userId": "11",
  "title": "Testing API",
  "body": "Post body data",
  "id": 101
}

Use Case 4: Lead Scoring

Description

When the user is asked to get the industry score for the target industry with the minimum score.

User Input: "Find warm prospects in fintech with score above 80"

API Configuration

Endpoint: https://crm.api.com/leads

Method: GET

Function Name: getQualifiedLeads

URL Structure

https://crm.api.com.xyz/leads?industry={{Tool_Params.target_industry}}&score_min={{Tool_Params.min_score}}

Tool Params Mapping

Variable

Value

Description

target_industry

fintech

Industry vertical to target

min_score

80

Minimum lead score threshold

Expected Response

{
  "qualified_leads": [
    {
      "id": "lead_001",
      "company": "TechBank Solutions",
      "contact_name": "Sarah Johnson",
      "score": 87,
      "industry": "fintech",
      "engagement_level": "high",
      "last_activity": "2024-08-28"
    }
  ],
  "total_count": 15,
  "avg_score": 84.2
}

Use Case 5: Support Priority Management

Description

When users are asked to show the tickets with their tier level and their status.

User Input: "Show open tickets from VIP customers"

API Configuration

Endpoint: https://support.api.com/tickets

Method: GET

Function Name: getPriorityTickets

URL Structure

https://support.api.com.xyz/tickets?customer_tier={{Tool_Params.tier_level}}&status={{Tool_Params.ticket_status}}

Tool Params Mapping

Variable

Value

Description

tier_level

VIP

Customer tier level

ticket_status

open

Current ticket status

Expected Response

{
  "priority_tickets": [
    {
      "ticket_id": "TKT-001",
      "customer_name": "Enterprise Corp",
      "tier": "VIP",
      "subject": "Integration Issue",
      "priority": "high",
      "created_date": "2025-08-30",
      "sla_deadline": "2025-09-01"
    }
  ],
  "total_vip_tickets": 7,
  "avg_response_time": "2.3 hours"
}

Use Case 6: Order Tracking

Description

When the user asked to check the status of the order with the order number.

User Input: "Where's order 12345?"

API Configuration

Endpoint: https://orders.api.com/track

Method: GET

Function Name: trackOrderStatus

URL Structure

https://orders.api.com.xyz/track?order_id={{Tool_Params.order_number}}

Tool Params Mapping

Value

Description

12345

Unique order identifier

Expected Response

{
  "order_details": {
    "order_id": "12345",
    "status": "in_transit",
    "tracking_number": "1Z999AA123456789",
    "estimated_delivery": "2024-09-03",
    "current_location": "Distribution Center - Chicago",
    "shipping_method": "express",
    "delivery_address": "123 Main St, New York, NY 10001"
  }
}

Was this article helpful?
©2025
Powered by YourGPT