Skip to main content

Connecting to External Systems and Tools

Connect MCP servers and REST APIs, including HTTP tools and file upload

Your AI agents in Thunk use tools to interact with external services and apps. In Thunk, these tools are accessed via the connections in your account or in resource environments.

Different systems have different ways of connecting to them. In Thunk, these are represented by different connection types.

Your connections are available under Account > Personal Resource Environment > Connections. From there, you can add a new connection.

Connections has a connection type:

  • MCP (Model Context Protocol) - this is the standard way that apps and services provide tools to AI agents.

  • REST API - other systems might provide a traditional software API, which can be converted to tools.

Each connection also has an authentication method (e.g. OAuth or API keys).

How to choose a connection type

Follow this guide, which starts with the simplest and easiest way.

Use an official MCP server.

Many services provide an MCP server that you can connect to out of the box. This is usually a URL that you can copy from the service.

Use a REST API with an OpenAPI spec.

If you don’t have an MCP server, you can use a REST API that has an OpenAPI spec. On the connection, set the API Base URL and an OpenAPI Spec URL. Thunk.AI converts the spec’s operations into tools for that connection. It also adds the six generic HTTP tools below, so you can still call a path that is not in the spec.

Use a REST API without an OpenAPI spec.

If you don’t have an OpenAPI spec, you can still call the API. On the connection, set the API Base URL and the authentication method. Thunk.AI adds these six tools:

Tool

What it does

On by default?

generic_api_get

HTTP GET

Yes

generic_api_post

HTTP POST with a JSON body

Yes

generic_api_put

HTTP PUT with a JSON body

No — turn it on

generic_api_patch

HTTP PATCH with a JSON body

No — turn it on

generic_api_delete

HTTP DELETE

No — turn it on

generic_api_post_binary

HTTP POST of a file’s raw bytes

No — turn it on

Each tool takes a relative path that starts with / and is appended to the API Base URL. GET and DELETE can also take query parameters. POST, PUT, and PATCH take an optional JSON body.

To use a tool that is off by default, open the thunk’s Connections pane, select the library for that connection, enable the library if it is not already on, and turn the tool on.

Upload a file through a REST API connection

Use generic_api_post_binary when the API wants the file itself — raw bytes — not a JSON object. Attachment and file-upload endpoints often work this way.

The tool does not take the file bytes as an argument. It takes:

  • path — the upload path on the API, starting with /. You can put query parameters in the path (for example /files/upload?name=report.pdf).

  • mimeType — sent as the request’s Content-Type (for example application/pdf or image/png). Leave it empty to send application/octet-stream.

  • publicContentUrl — an http(s) URL the file can be downloaded from without signing in to the API. Use a public URL, or a signed download URL for a file on this thunk.

Thunk.AI downloads that URL, then POSTs the downloaded bytes to your API with the connection’s authentication. The download itself does not use the API’s credentials.

  1. Add a REST API connection with the API Base URL and authentication.

  2. In the thunk, open Connections and enable the library.

  3. Turn on generic_api_post_binary.

  4. Give the AI agent a downloadable URL, the MIME type, and the upload path. For a file on this thunk, turn on Convert URLs to signed download URLs for publicContentUrl, or in a custom code tool pass getDownloadLink().

Do not use generic_api_post for these endpoints — that tool sends a JSON body, not the file.

Narrow a connected tool with a Tool Wrapper

Connected tools are often general — a search with many filters, or a ticket tool with many fields. If a workflow always calls one the same way, open the tool's detail and choose Customize this tool to build a Tool Wrapper that fixes the arguments you always use and leaves the AI agent only the inputs that change. See How to build a Tool Wrapper.

More Examples

  • Connecting Databricks VectorSearch to Thunk

  • Connecting Thunk to my Databricks SQL MCP server

  • Connecting Thunk to Salesforce

If a connected tool needs to download a file that only the thunk can open — an upload, or a Drive or SharePoint file — turn on Convert URLs to signed download URLs in that tool's Settings. See Pass a file to a connected tool with a signed download URL. To send a thunk file to a REST API as raw bytes, use generic_api_post_binary as described above.

Did this answer your question?