---
title: "View source for AI Services/Custom Tools - DreamFactory Wiki"
source: "https://wiki.dreamfactory.com/index.php?action=edit&title=AI_Services%2FCustom_Tools"
canonical_url: "https://wiki.dreamfactory.com/index.php?action=edit&title=AI_Services%2FCustom_Tools"
converted_at: "2026-11-23T01:11:46.486Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# View source for AI Services/Custom Tools

	
		
		← [AI Services/Custom Tools](/AI_Services/Custom_Tools)
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		You do not have permission to edit this page, for the following reason:

The action you have requested is limited to users in the group: [Users](/index.php?title=DreamFactory_Wiki:Users&action=edit&redlink=1).---

You can view and copy the source of this page.

{{#seo:
|title=Custom MCP Tools - DreamFactory Documentation
|title_mode=replace
|description=Create custom tools for your MCP server to extend AI assistant capabilities with API calls and JavaScript functions.
|keywords=custom tools, MCP, AI tools, function tools, API tools, DreamFactory AI
|og:title=Custom MCP Tools
|og:type=article
|og:site_name=DreamFactory Documentation
|og:description=Create custom tools for your MCP server to extend AI assistant capabilities with API calls and JavaScript functions.
}}
'''Create custom tools for your MCP server to extend AI assistant capabilities with API calls and JavaScript functions.'''

&lt;span id="custom-mcp-tools">&lt;/span>
= 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'''.

&lt;span id="api-tools">&lt;/span>
== 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.

[[File:custom-tool-api-type.png|thumb|Custom Tool - API Type]]
&lt;span id="configuration-fields">&lt;/span>
=== Configuration Fields ===

{| class="wikitable"
|-
! 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 &lt;code>{param}&lt;/code> 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).
|}

&lt;span id="example-weather-api-tool">&lt;/span>
=== Example: Weather API Tool ===

* '''Tool Name''': &lt;code>get_weather&lt;/code>
* '''HTTP Method''': GET
* '''URL''': &lt;code>https://api.weather.com/v1/forecast/{city}&lt;/code>
* '''Description''': "Get the current weather forecast for a given city."
* '''Parameters''': Add a &lt;code>city&lt;/code> parameter of type &lt;code>string&lt;/code>.

&lt;span id="function-tools">&lt;/span>
== 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.

[[File:custom-tool-function-type.png|thumb|Custom Tool - Function Type]]
&lt;span id="configuration-fields-1">&lt;/span>
=== Configuration Fields ===

{| class="wikitable"
|-
! 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.
|}

&lt;span id="example-unit-conversion-tool">&lt;/span>
=== Example: Unit Conversion Tool ===

* '''Tool Name''': &lt;code>convert_celsius_to_fahrenheit&lt;/code>
* '''Description''': "Convert a temperature from Celsius to Fahrenheit."
* '''Parameters''': Add a &lt;code>celsius&lt;/code> parameter of type &lt;code>number&lt;/code>.
* '''Function body''':

&lt;syntaxhighlight lang="javascript">return (celsius * 9/5) + 32;&lt;/syntaxhighlight>
&lt;span id="adding-parameters">&lt;/span>
== 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 &lt;code>{param}&lt;/code> 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.

&lt;span id="best-practices">&lt;/span>
== 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., &lt;code>search_orders&lt;/code> rather than &lt;code>tool1&lt;/code>).
* '''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 ==
* [[AI_Services/Mcp_Service_Creation|Creating an MCP Server Service]]
* [[AI_Services/Mcp_Service|MCP Server]]
* [[AI_Services/Mcp_Custom_Login_Page|Custom Login Page for MCP]]
* [[AI_Services/AI_Chat|AI Chat]]

[[Category:Custom_Tools]]
[[Category:Mcp]]
[[Category:Ai_Tools]]
[[Category:Difficulty_Advanced]]
Return to [AI Services/Custom Tools](/AI_Services/Custom_Tools).

Retrieved from "[https://wiki.dreamfactory.com/AI_Services/Custom_Tools](https://wiki.dreamfactory.com/AI_Services/Custom_Tools)"