Skip to main content

Connecting Tools & APIs

An AI that can only talk is useful, but an AI that can do things is powerful. Tools let your agent search the web, send emails, query databases, create calendar events, and interact with virtually any online service.

What Are Tools?​

Tools are actions your AI agent can perform. When a user asks a question, the agent decides:

  1. Can I answer this from what I already know? β†’ Just respond
  2. Do I need to look something up or do something? β†’ Use a tool

For example, if someone asks "What's the weather today?", the agent knows it needs to use a weather tool because it doesn't have real-time weather data.

Types of Tools in CiniterFlow​

1. Built-in Tools (Ready to Use)​

CiniterFlow comes with many pre-built tools. Here are the most popular:

ToolWhat It DoesYou'll Need
Google Custom SearchSearches the webGoogle API key
CalculatorDoes math calculationsNothing
Current DateTimeGets the current date/timeNothing
Web ScraperReads content from web pagesNothing
GmailSends and reads emailsGoogle OAuth
Google CalendarManages calendar eventsGoogle OAuth
SerperWeb search (alternative to Google)Serper API key

2. Custom Tools (Build Your Own)​

When a built-in tool doesn't exist for what you need, you can create one! Custom tools let you write JavaScript code that runs when the agent calls the tool.

3. MCP Tools (Industry Standard)​

MCP (Model Context Protocol) tools connect to external servers that provide tools. Many companies maintain their own MCP servers (GitHub, Jira, Brave Search, etc.).

4. Request Tools (Direct API Calls)​

These let the agent make HTTP requests (GET, POST, PUT, DELETE) to any API.

Adding a Built-in Tool to Your Agent​

In Agentflow​

  1. Open your Agentflow and click on an Agent node
  2. Scroll to the Tools section
  3. Click "+ Add Tool"
  4. Select the tool from the dropdown (e.g., "Google Custom Search")
  5. Configure any required credentials
  6. Save your flow

In Chatflow​

  1. Drag the tool node onto the canvas (e.g., drag "Serper" from the Tools category)
  2. Configure the tool's credentials
  3. Connect it to your Agent node

Creating a Custom Tool​

Let's create a custom tool that checks if a store is currently open:

Step 1: Go to Tools​

  1. Click "Tools" in the left sidebar
  2. Click "+ Add New"

Step 2: Configure the Tool​

  • Tool Name: check_store_hours
  • Tool Description: Use this tool to check if the store is currently open based on the current day and time.

Step 3: Define Input Schema​

The input schema tells the AI what information the tool needs:

{
"type": "object",
"properties": {
"day": {
"type": "string",
"description": "The day of the week (e.g., Monday, Tuesday)"
},
"time": {
"type": "string",
"description": "The current time in HH:MM format"
}
},
"required": ["day", "time"]
}

Step 4: Write the Function​

const storeHours = {
'Monday': { open: '09:00', close: '18:00' },
'Tuesday': { open: '09:00', close: '18:00' },
'Wednesday': { open: '09:00', close: '18:00' },
'Thursday': { open: '09:00', close: '20:00' },
'Friday': { open: '09:00', close: '20:00' },
'Saturday': { open: '10:00', close: '16:00' },
'Sunday': { open: 'closed', close: 'closed' }
};

const hours = storeHours[$day];
if (!hours || hours.open === 'closed') {
return `The store is closed on ${$day}.`;
}

if ($time >= hours.open && $time <= hours.close) {
return `The store is currently OPEN. Hours today (${$day}): ${hours.open} - ${hours.close}`;
} else {
return `The store is currently CLOSED. Hours on ${$day}: ${hours.open} - ${hours.close}`;
}

Step 5: Save and Use​

Save the tool, then add it to any Agent node in your flows!

Using MCP (Model Context Protocol)​

MCP is the modern, standardized way to connect AI to external services. Think of it as a universal adapter.

This is the easiest way to use MCP β€” just provide a URL:

  1. In your Agent node, add a Custom MCP tool
  2. Set the transport type to Streamable HTTP
  3. Enter the MCP server configuration:
{
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer {{$vars.githubToken}}"
}
}
  1. Click "Refresh Available Actions" to see what the MCP server offers
  2. Select the actions you want your agent to use

Stdio (For Local Development)​

For running MCP servers locally:

{
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}

Connecting to Any API (OpenAPI Toolkit)​

If you have an API with an OpenAPI/Swagger specification, CiniterFlow can automatically turn every endpoint into a tool:

  1. Add an Agent node to your flow
  2. Add the OpenAPI Toolkit tool
  3. Upload your OpenAPI YAML file
  4. CiniterFlow automatically creates a tool for each API endpoint
  5. The agent can now call any of those endpoints!

This is incredibly powerful β€” instead of creating individual tools for each API endpoint, you upload one file and get them all.

Tips for Working with Tools​

1. Write Clear Tool Descriptions​

The AI decides which tool to use based on the description. Be specific:

❌ Bad: "A search tool" βœ… Good: "Use this tool to search the internet for current information, news, and real-time data that you don't have in your training data"

2. Don't Overload with Tools​

If an agent has too many tools (15+), it can get confused about which one to use. If you need many tools, consider splitting into multiple specialized agents.

3. Use "Require Human Input" for Sensitive Actions​

For tools that do something irreversible (sending emails, deleting data, making purchases), enable "Require Human Input". This pauses the flow and asks a human to approve before the tool runs.

4. Include Current Time in System Prompts​

Many tools work better when the AI knows the current time. Add this to your system prompt:

Today's date and time is {{ current_date_time }}

5. Test Tools Individually​

Before adding a tool to a complex flow, test it in a simple Agent to make sure it works correctly.

What's Next?​

Your agent can now think, search knowledge, AND take action! Next, let's learn how to put your chatbot on a website for the world to use.

πŸ‘‰ Embedding Your Chatbot