DeepFellow DOCS

Using Tools

Tool calling provides a powerful and flexible way for models to interface with external systems and access information from outside their training data.

Tools and Toolboxes

Tools expose discrete capabilities to the model. When generating a response, the model determines whether an instruction requires invoking a Tool – for example, to retrieve data or execute a specific operation.

In DeepFellow, the concept of Tools is equivalent to the concept of Function Calling in OpenAI API. Within the DeepFellow architecture, Tools are orchestrated by MCP Servers according to the Model Context Protocol (MCP).

A Toolbox is an MCP Server that aggregates Tools, resources, and prompts from all the MCP Servers it contains. Use Toolboxes to organize Tools into groups and simplify Tool calling.

Supported MCP Protocols

DeepFellow Server and DeepFellow Infra support the following MCP protocols:

  • Streamable HTTP (path: /mcp)
  • SSE (path: /sse)

The examples in this guide use Streamable HTTP.

Tool Types

DeepFellow supports the following Tool types:

  • File Search – searches DeepFellow Server vector stores using DeepFellow Server's v1/vector_stores API.
  • Knowledge Graph – searches the project's knowledge graph.
  • Image Generation – generates images using DeepFellow Infra's v1/images/generations API.
  • External MCP – connects to external MCP Servers.
  • Infra MCP – uses Tools hosted on DeepFellow Infra via mcp service.
  • Websearch – searches web pages and fetches their content.
  • Custom – uses DeepFellow Infra's custom service.

Adding Toolboxes

You can also create and manage Toolboxes and Tools from the DeepFellow Server Web Panel.

To add a Toolbox, use the POST /toolboxes/ endpoint:

curl -X POST \
  'https://your-deepfellow-server.com/toolboxes/' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json' \
  -d '{"name": "my-toolbox"}'

Adding Tools

To add Tools to a Toolbox, use POST /toolboxes/{TOOLBOX_ID}/tools endpoint with the appropriate schema in the body:

curl -X POST \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/tools' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json' \
  -d '{ TOOL_BODY }'

The following tabs show the request body for each Tool type.

Header Values in Responses

Tool headers usually hold credentials, such as tokens and API keys. DeepFellow Server stores the header values you send and uses them in tool calls, but never returns them. Every response of the tool endpoints (create, list, retrieve, update, and remove) shows the mask •••••••• in place of each header value:

{
    "type": "mcp",
    "server_label": "Git MCP",
    "server_url": "https://your-mcp-server.com/mcp",
    "headers": {
        "Authorization": "••••••••",
        "Accept": "application/json"
    }
}

The following rules apply:

  • The mask covers headers of External MCP, Infra MCP, and Custom tools, fetch.headers and search.headers of Websearch tools, and tools[].request.headers of Custom tools.
  • The values of the Accept, Content-Type, and User-Agent headers are returned unchanged. The comparison of header names ignores case.
  • An empty header value is returned as an empty string.
  • POST /toolboxes/{TOOLBOX_ID}/tools returns 400 if a header value in the request is the mask.

No endpoint reveals a stored header value. Keep the original values in your own secret store.

Header Encryption

DeepFellow Server encrypts header values before it saves them in MongoDB and decrypts them only to send a Tool call. A dump or a backup of the database alone does not reveal the credentials.

The following rules apply:

  • Encryption covers headers of External MCP, Infra MCP, and Custom Tools, fetch.headers and search.headers of Websearch Tools, and tools[].request.headers of Custom Tools.
  • The values of the Accept, Content-Type, and User-Agent headers and empty values stay in plain text. The comparison of header names ignores case.
  • An encrypted value in the database starts with enc:v1:.
  • Only the server writes the enc:v1: prefix. A request returns 400 if a header value starts with it. This applies to creating and updating a Tool, and to a Tool passed directly in a v1/responses request.
  • At the first start after the update, a database migration encrypts the header values that an earlier version stored in plain text.

The encryption key is in config.json, next to the dynamic settings. For details, see Encryption Key.

Encryption protects against a leak of the database alone. It does not protect against a backup of the server's storage directory together with the database. It also does not protect against access to a running server container.

The server decrypts the headers only with the key that encrypted them. If you lose config.json, the server generates a new key at the next start. A request that calls the Tool then returns 500 with the message Tool headers cannot be decrypted with the configured encryption key.

To fix the error, restore config.json from a backup, or update the Tool and send every header value again. A header sent as the mask •••••••• keeps the stored value, which stays unreadable for the server.

Tool Calling

Each Toolbox and each Tool has its own MCP server URL. Connect to it like to any streamable-http or SSE (Server-Sent Events) MCP server:

  • Toolbox URL: http://your-deepfellow-server.com/toolboxes/[TOOLBOX_ID]/mcp

  • Tool URL: http://your-deepfellow-server.com/toolboxes/[TOOLBOX_ID]/tools/[TOOL_ID]/mcp

  • Header: An Authorization bearer token.

    Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY

For SSE, replace /mcp with /sse.

DeepFellow Server no longer supports the df://local/ protocol. POST /v1/responses returns 400 for an MCP Tool whose server_url starts with df://. Pass the MCP server URL of the Toolbox or Tool instead.

Via MCP Inspector

You can test Tools using the MCP Inspector.

  1. Run npx @modelcontextprotocol/inspector node build/index.js.

  2. Set Transport Type to the preferred mode: Streamable HTTP or SSE.

  3. In the URL field, enter your Tool or Toolbox URL:

    • Tool URL: https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID}/mcp
    • Toolbox URL: https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/mcp

    For SSE, replace /mcp with /sse.

  4. Expand the Authentication section, enter Authorization in the header field, and Bearer {DEEPFELLOW_PROJECT_API_KEY} as the value. Make sure the toggle is enabled.

    View of correctly filled fields in MCP Inspector.

  5. Click Connect. A green notification indicates a successful connection.

  6. From the toolbar, select Tools and click List Tools. The list of Tools appears after a moment.

    Tool list in MCP Inspector.

  7. Select a Tool and click Run Tool to use it.

Via v1/responses

  • Tool

    curl -X POST \
      'http://your-deepfellow-server.com/v1/responses' \
      -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
      -H 'Content-Type: application/json' \
      -H 'accept: application/json' \
      -d '{
      "input": "Find me connection between Berlin HBF and airport",
      "model": "qwen3:8b",
      "tools": [
        {
          "type": "mcp",
          "server_label": "Berlin Bus Transport",
          "server_description": "Searching connections between different bus stations in Berlin.",
          "server_url": "http://your-deepfellow-server.com/toolboxes/69b97a9d0a101cfacc4282b2/tools/c89f6bdd67924f339911cd5c3d6c222f/mcp",
          "headers": {
             "Authorization": "Bearer DEEPFELLOW_PROJECT_API_KEY"
          }
        }
      ]
    }'
  • Toolbox

    curl -X POST \
      'http://your-deepfellow-server.com/v1/responses' \
      -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
      -H 'Content-Type: application/json' \
      -H 'accept: application/json' \
      -d '{
      "input": "Find me connection between Berlin HBF and airport",
      "model": "qwen3:8b",
      "tools": [
        {
          "type": "mcp",
          "server_label": "Berlin Transport",
          "server_description": "Searching connections in Berlin.",
          "server_url": "http://your-deepfellow-server.com/toolboxes/69b97a9d0a101cfacc4282b2/mcp",
          "headers": {
             "Authorization": "Bearer DEEPFELLOW_PROJECT_API_KEY"
          }
        }
      ]
    }'
    

Approving Tool Calls

When a tool requires approval, /v1/responses doesn't run it. Instead, the response output contains an mcp_approval_request item:

{
  "type": "mcp_approval_request",
  "id": "call_daz8sgvr",
  "server_label": "Berlin Bus Transport",
  "name": "find_connection__berlin_bus_transport",
  "arguments": "{\"from\": \"Berlin HBF\", \"to\": \"BER Airport\"}"
}

In a streaming response, the mcp_approval_request item arrives in response.output_item.added and response.output_item.done events before response.completed.

To answer, send another request with the same tools. In input, send your previous input, the previous output, and an mcp_approval_response for each mcp_approval_request:

{
  "type": "mcp_approval_response",
  "approval_request_id": "call_daz8sgvr",
  "approve": true
}

If your previous input was a string, send it as a user message.

If approve is true, DeepFellow runs the tool once. If approve is false, DeepFellow doesn't run the tool. The model receives a message that the user declined the call, followed by the reason from the mcp_approval_response, if you set one.

/v1/responses returns 422 if:

  • An mcp_approval_response has no matching mcp_approval_request
  • An mcp_approval_request has no mcp_approval_response
  • The tool in an mcp_approval_request is missing from tools

Updating Tools and Toolboxes

To update a Tool, use POST /toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID} endpoint. It accepts the same schema as the Tool creation endpoint, with all fields optional:

curl -X POST \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID}' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json' \
  -d '{ TOOL_BODY }'

Similarly, to update a Toolbox, use POST /toolboxes/{TOOLBOX_ID} endpoint. It accepts the same schema as the Toolbox creation endpoint, with all fields optional:

curl -X POST \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json' \
  -d '{"name": "my-toolbox"}'

Updating Tool Headers

An update replaces the whole headers object. In an update request, the mask •••••••• means "keep the stored value". This way, you read a tool, edit one field, and send the whole definition back without overwriting the stored credentials.

  • To keep a header, send its name with the mask as the value.
  • To change a header, send its name with the new value.
  • To remove a header, leave it out of the headers object.
  • To keep all headers, leave the headers field out of the request.
  • To remove all headers, send an empty headers object.

The following request changes X-Api-Key, keeps Authorization, and removes every other header:

curl -X POST \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID}' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "headers": {
        "Authorization": "••••••••",
        "X-Api-Key": "NEW_API_KEY"
    }
  }'

fetch and search of a Websearch tool, and each entry of tools in a Custom tool, are replaced as a whole. If you send one of them without headers, its stored headers are removed.

The update returns 400 in the following cases:

  • A header value is the mask, and the tool stores no header with that name. Header names are matched exactly, including case.
  • The update changes the target of the headers, and the stored values would stay in place.
  • A header value starts with enc:v1:.

The target of the headers depends on the tool type:

Tool typeHeader fieldFields that define the target
External MCPheadersserver_url
Infra MCPheadersserver_prefix, server_transport
Websearchfetch.headersprefix, transport, and tool of fetch
Websearchsearch.headersprefix, transport, and tool of search
Customheadersserver_prefix
Customtools[].request.headersserver_prefix, request.path, request.method

Stored header values never follow a tool to a new target. If you change the target, send every header value again, or send an empty headers object.

The entries of tools in a Custom tool have no identifier. DeepFellow Server matches an updated entry to the stored entry with the same name. If the name is new, the entry matches the stored entry at the same position, provided that the name of the stored entry is no longer on the list. A masked header value in an entry without a match returns 400.

If another request changes the tool at the same time, the update returns 409. In that case, fetch the tool again and retry the update.

Removing Tools and Toolboxes

To remove a Tool, use DELETE /toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID} endpoint:

curl -X DELETE \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}/tools/{TOOL_ID}' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json'

Similarly, to remove a Toolbox, use DELETE /toolboxes/{TOOLBOX_ID} endpoint:

curl -X DELETE \
  'https://your-deepfellow-server.com/toolboxes/{TOOLBOX_ID}' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'accept: application/json'

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.

On this page