> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

> Learn how to use tool calling with your large language models in the Humanloop Prompt Editor.

Humanloop's Prompt Editor supports tool calling functionality, enabling models to interact with external systems.
This feature, equivalent to [OpenAI's function calling](https://platform.openai.com/docs/guides/function-calling) or [Anthropic's tool use](https://docs.anthropic.com/en/docs/build-with-claude/tool-use),
is implemented through JSON Schema Tools in Humanloop. These Tools adhere to the widely-used JSON Schema syntax, providing a standardized way to define data structures.

Within the Editor, you can create inline JSON Schema Tools as part of your Prompt.
This capability allows you to establish a structured framework for the model's responses, enhancing control and predictability.

### Prerequisites

* You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first.

## Create an inline JSON Schema Tool

### **Open the Editor**

Go to a Prompt and open the Editor.

### **Select a model that supports Tool Calling**

> **Models supporting Tool Calling**
>
> To view the list of models that support Tool calling, see the [Models page](/docs/reference/models#models).

In the Editor, you'll see an option to select the model. Choose a model like `gpt-4.1-nano` which supports Tool Calling.

### **Define the Tool**

To get started with creating an inline tool, let's use one of our preloaded examples.

Click on the **+ Tool** button in the bottom left of the Editor. Select **New inline tool...**.

![](/docs/_fern-img/8c7c0b3b036d3427d4d31c71b768a463bde004307bd2469aaf9a051e639a643b.webp)

In the modal that appears, open the **Examples** dropdown and select the `get_current_weather` tool.

![](/docs/_fern-img/2ac346a76be48c9dc4b4dcdaa890d5674eab5803a7648b4dcb1cb5d3ab2e5891.webp)

If you choose to edit or create your own tool, you'll need to use the [JSON Schema syntax](https://json-schema.org/).
When creating a custom tool, it should correspond to a function you have defined in your own code.
The JSON Schema you define here specifies the parameters and structure you want the AI model to use when interacting with your function.

![](/docs/_fern-img/a879c7a117384c931cb39232c327921b0ba6b87a0d1cc8f190cba4bac3205281.webp)

## Test the Tool

Now, let's test our Tool by inputting a relevant query. Since we're working with a weather-related tool, try typing: "What's the weather in Boston?"
This should prompt the model to respond using the parameters we've defined.

> **Tool calling is context-sensitive**
>
> Keep in mind that the model's use of the tool depends on the relevance of the user's input.
> For instance, a question like '*How are you today?*' is unlikely to trigger a weather-related tool call.

### **Check tool call**

Upon successful setup, the assistant should respond by invoking the tool, providing both the tool's name and the required data.
For our `get_current_weather` tool, the response might look like this:

![](/docs/_fern-img/78a45a99464425f6a5c923e4573b6a3d7adbc37213f3f210fb3a479a33d28bfd.webp)

### **Submit tool response**

You can also check how the Prompt would respond to a successful tool call.

Click on the **Add to Messages** button to move the assistant's response into the Messages section
for a subsequent call.

Then, you can paste in the exact response that the Tool would respond with into the **Output** section of the Tool call.
For prototyping purposes, you can also just simulate the response yourself. Provide in a mock response:

```json
{ "temperature": 65, "condition": "light rain", "unit": "fahrenheit" }
```

![](/docs/_fern-img/ec07617cf3941342c5e646a00f19263f7bddc2aa6887fd0589472cd5c624f71e.webp)

Remember, the goal is to simulate the tool's output as if it were actually fetching real-time weather data.
This allows you to test and refine your prompt and tool interaction without needing to implement the actual weather API.

After entering the simulated tool response, click on the **Run** button to send the Tool's response to the AI model.

### **Review assistant response**

The assistant should now respond using the information provided in your simulated tool response.
For example, if you input that the weather in Boston was 65°F and light rain, the assistant might say:

`The current weather in Boston is light rain with a temperature of 65°F.`

This response demonstrates how the AI model incorporates the tool's output into its reply, providing a more contextual and data-driven answer.

![](/docs/_fern-img/245e7582c48ebb5e738381bb4738c5d1254122e0d0e58f3266155b3763fca921.webp)

### **Iterate and refine**

Feel free to experiment with different queries. This iterative process helps you fine-tune your Prompt and understand how the AI model interacts with the tool,
ultimately leading to more effective and accurate responses in your application.

### **Save your Prompt**

By saving your Prompt, you will create a new version that includes the inline tool.

Congratulations! You've successfully learned how to use tool calling in the Humanloop Editor. This powerful feature allows you to test tool interactions, helping you create more dynamic and context-aware AI applications.

## Next steps

After you've created and tested your inline Tool, you might want to reuse it across multiple Prompts.
Humanloop allows you to link a Tool, making it easier to share and manage Tool definitions across multiple Prompts.

For more detailed instructions on how to link and manage Tools, check out our guide on [Linking a JSON Schema Tool](/docs/v5/guides/prompts/tool-calling-editor).