> 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.

> Discover how Humanloop manages tools for use with large language models (LLMs) with version control and rigorous evaluation for better performance.

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

Tools on Humanloop are used to extend [Agents](/docs/explanation/agents) and [Prompts](/docs/explanation/prompts) with access to external data sources and enable them to take action.

## Types of Tools

### Runnable Tools

Runnable Tools can be executed by Humanloop, meaning they can form a part of an Agent's automatic execution.
Python code Tools, an example of these, are run in a [secure Python runtime](/docs/v5/reference/python-environment) and allow you to write custom code to be executed.

![Editor for a Python Tool showing a \`calculate\` function and a calculation output.](/docs/_fern-img/821e7d637660e44f60d385922a2c25f81a79ee7755eff9a8f4ab67fd3c6a5a5b.webp)

### Template Tools

Template Tools can be used within a Prompt's template to dynamically insert information for the model when called.
These include:

* **Snippet Tools**: Reusable text components that can be shared across multiple Prompts
* **Integration Tools**: Pre-built connectors to popular services like Google Search and Pinecone vector database

![Editor for a Snippet Tool showing a \`humanloop\_context\` Tool with various key-value pairs.](/docs/_fern-img/4fc6430204c802dd1c6732b43be44e95931b1b26a9f32361fbabfa3a1eb4b974.webp)

### Function calling Tools

Many models, such as those by [OpenAI](https://platform.openai.com/docs/guides/function-calling) and [Anthropic](https://docs.anthropic.com/en/docs/build-with-claude/tool-use), now support function calling.
You can provide these models with definitions of the available tools. The model then decides whether to call a tool, and which parameters to use.

On Humanloop, [JSON schema Tools](/docs/v5/guides/prompts/tool-calling-editor) record the schema definitions that are used for function calling,
allowing you to tweak and version control them.

```js
{
  "name": "get_current_weather",
  "description": "Get the current weather in a given location",
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "name": "Location",
        "description": "The city and state, e.g. San Francisco, CA"
      },
      "unit": {
        "type": "string",
        "name": "Unit",
        "enum": [
          "celsius",
          "fahrenheit"
        ]
      }
    },
    "required": [
      "location",
      "unit"
    ]
  }
}
```

In addition to JSON schema Tools, all Runnable Tools and Prompts can be used for function calling. Humanloop will automatically generate the schema definitions
for these when they're linked to a Agent or Prompt.

![Agent Editor with a Calculator Tool linked. The Tool is called by the Agent and the results are shown.](/docs/_fern-img/d5ee08c2493e20b77a743c5c03c91c2ec42cd5f887f56b836d89f0268187dc60.webp)

## Humanloop runtime versus your runtime

Humanloop supports running Python code Tools within the Humanloop runtime. If you have Tools that you want to run in your own environment,
you can use the Humanloop API to manage versions and record Logs.

The simplest way to do this is by decorating a function with the [Tool decorator](/docs/v5/sdk/decorators/tool) in the SDK.
Running the decorated function will automatically log the inputs and output of the function
to Humanloop. If you're using the Python SDK, the `@tool` decorator will also infer a JSON schema from the function's type hints.