---
title: "Custom MCP Tools - DreamFactory Documentation"
source: "http://wiki.dreamfactory.com/AI_Services/Custom_Tools"
canonical_url: "http://wiki.dreamfactory.com/AI_Services/Custom_Tools"
converted_at: "2026-10-22T18:50:41.680Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# AI Services/Custom Tools

	
		From DreamFactory Wiki
		
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		**Create custom tools for your MCP server to extend AI assistant capabilities with API calls and JavaScript functions.**

## Contents

- [1 Custom MCP Tools](#Custom_MCP_Tools)

- [1.1 API Tools](#API_Tools)

- [1.1.1 Configuration Fields](#Configuration_Fields)

- [1.1.2 Example: Weather API Tool](#Example:_Weather_API_Tool)

- [1.2 Function Tools](#Function_Tools)

- [1.2.1 Configuration Fields](#Configuration_Fields_2)

- [1.2.2 Example: Unit Conversion Tool](#Example:_Unit_Conversion_Tool)

- [1.3 Adding Parameters](#Adding_Parameters)

- [1.4 Best Practices](#Best_Practices)

- [1.5 See also](#See_also)

# Custom MCP Tools

DreamFactory allows you to create custom tools that extend the capabilities of your MCP server beyond the built-in database and file operations. Custom tools let you define additional actions that AI assistants can invoke during a conversation — such as calling external APIs or running custom logic.

There are two types of custom tools: **API** and **Function**.

## API Tools

API tools allow the AI assistant to make HTTP requests to external or internal endpoints. This is useful for integrating third-party services, webhooks, or any REST API into your AI workflow.

[![](/images/4/48/Custom-tool-api-type.png)](/File:Custom-tool-api-type.png)Custom Tool - API Type

### Configuration Fields

Field

Required

Description

**Tool Name**

Yes

A unique identifier for the tool. Letters, numbers, and underscores only.

**HTTP Method**

Yes

The HTTP method to use (GET, POST, PUT, DELETE, etc.).

**URL**

Yes

The endpoint URL to call. Use `{param}` syntax for path parameters.

**Description**

Yes

A description of what the tool does. This description is shown to the LLM to help it decide when to use the tool.

**Parameters**

No

Input parameters that the AI assistant can pass when invoking the tool. Click **+ Add Parameter** to define inputs.

**Static Headers (JSON)**

No

A JSON object of headers to include with every request (e.g., authorization tokens, content type).

### Example: Weather API Tool

- **Tool Name**: `get_weather`

- **HTTP Method**: GET

- **URL**: `[https://api.weather.com/v1/forecast/{city}](https://api.weather.com/v1/forecast/{city})`

- **Description**: "Get the current weather forecast for a given city."

- **Parameters**: Add a `city` parameter of type `string`.

## Function Tools

Function tools let you write custom JavaScript that runs server-side when the AI assistant invokes the tool. This is ideal for data transformation, custom calculations, or any logic that doesn't require an external API call.

[![](/images/0/0b/Custom-tool-function-type.png)](/File:Custom-tool-function-type.png)Custom Tool - Function Type

### Configuration Fields

Field

Required

Description

**Tool Name**

Yes

A unique identifier for the tool. Letters, numbers, and underscores only.

**Description**

Yes

A description of what the tool does. This description is shown to the LLM to help it decide when to use the tool.

**Parameters**

No

Input parameters that the AI assistant can pass when invoking the tool. Click **+ Add Parameter** to define inputs.

**Function (JavaScript function body)**

Yes

The JavaScript code that executes when the tool is called. Parameters are available as variables within the function body.

### Example: Unit Conversion Tool

- **Tool Name**: `convert_celsius_to_fahrenheit`

- **Description**: "Convert a temperature from Celsius to Fahrenheit."

- **Parameters**: Add a `celsius` parameter of type `number`.

- **Function body**:

```
return (celsius * 9/5) + 32;

```

## Adding Parameters

Both tool types support custom parameters. Click **+ Add Parameter** to define inputs for your tool. Each parameter has:

- **Name**: The parameter name (used as a variable in Function tools or as `{param}` in API tool URLs).

- **Type**: The data type (e.g., string, number, boolean).

- **Description**: Helps the LLM understand what value to provide.

- **Required**: Whether the parameter must be provided when calling the tool.

## Best Practices

- **Write clear descriptions** — The LLM relies on the tool description and parameter descriptions to determine when and how to use the tool. Be specific about what the tool does and what inputs it expects.

- **Use meaningful names** — Tool names should clearly indicate their purpose (e.g., `search_orders` rather than `tool1`).

- **Keep functions focused** — Each tool should do one thing well. Create multiple tools rather than one complex tool.

- **Validate inputs in functions** — For Function tools, add input validation in your JavaScript to handle edge cases gracefully.

## See also

- [Creating an MCP Server Service](/AI_Services/Mcp_Service_Creation)

- [MCP Server](/AI_Services/Mcp_Service)

- [Custom Login Page for MCP](/AI_Services/Mcp_Custom_Login_Page)

- [AI Chat](/AI_Services/AI_Chat)

Retrieved from "[https://wiki.dreamfactory.com/index.php?title=AI_Services/Custom_Tools&oldid=953](https://wiki.dreamfactory.com/index.php?title=AI_Services/Custom_Tools&oldid=953)"
		[Categories](/Special:Categories): - [Custom Tools](/index.php?title=Category:Custom_Tools&action=edit&redlink=1)
- [Mcp](/Category:Mcp)
- [Ai Tools](/index.php?title=Category:Ai_Tools&action=edit&redlink=1)
- [Difficulty Advanced](/Category:Difficulty_Advanced)