Guides

Guide 08

Extend an agent with tools, MCP servers and skills

Let an agent write its own reusable tools, review and edit them, inject secrets, connect external MCP servers, and add skills the agent loads on demand; platform tools and the skills library are shared across projects.

On this page
  1. Let the agent create its own tools with create_tool
  2. Review, edit and control agent-created tools
  3. Inject secrets into a tool
  4. Connect an external MCP server
  5. Add a skill to an agent
  6. Platform tools: write a tool once for every agent
  7. Run code with the code interpreter and shell tools (inference projects)

Built-in tools cover general work. To connect an agent to your own systems, you can let the agent write its own tools, connect it to external MCP servers, and give it skills: named procedures it loads only when needed. All three are managed on the agent's Tools & MCP tab.

Let the agent create its own tools with create_tool

With the create_tool built-in tool, the agent can write a new tool (Python code plus a parameter schema), test it in its sandbox and save it to the project. The next time a similar task comes up, the agent calls the saved tool instead of writing code again, which is much faster and uses far fewer tokens.

  1. Open Tools & MCP > Behaviour > Built-in tools.
  2. Add both create_tool and terminal. create_tool needs the terminal to write and test code.
  3. Click Save.
  4. In Playground, ask for a tool, for example: "Create a tool that calculates the first N prime numbers."
  5. The agent writes the code, tests it in its sandbox and saves it. It can then call the new tool by name (for example first_n_primes). In Logs, the Tool trace of that turn shows create_tool, the test runs and the call of the new tool.
  6. Open a new session and ask a task the tool covers ("Calculate the first 10 primes"). The agent calls the saved tool directly.

Tools the agent creates appear under Agent-created tools and are automatically available in every conversation for the project. Tool names use letters, digits and underscores only.

This pattern suits business actions: for example tools to renew, suspend or generate a licence in your own software, which an assistant or chat widget can then call.

Agent-created tools list with the first_n_primes tool, its Enabled switch, and edit and delete buttons

Review, edit and control agent-created tools

A tool the agent writes is not a black box. A person can review and change it before relying on it.

  1. Open Tools & MCP and scroll to Agent-created tools. Each row shows Name, Description, Updated and Enabled.
  2. Click the edit (pencil) icon to open the tool. You can change:
    • Description: what the tool does. The model reads this to decide when to call it.
    • Parameters (JSON schema): the arguments the tool accepts.
    • Code (Python): the code receives an args dict with the parameters and prints its result to stdout. A counter under the editor shows the size against the 10,240-byte limit.
  3. Click Save.
  4. To stop the agent from using a tool without deleting it, turn off Enabled. Use the delete (bin) icon to remove it.

Review the code of every agent-created tool before using it in production, especially tools that call external systems.

Edit dialog of an agent-created tool with Description, Project secrets, Parameters (JSON schema) and Code (Python)

Inject secrets into a tool

Tools that call external APIs (a CRM, a billing system) need credentials. Store them once as project secrets and pass them to the tools that need them.

  1. Add the credential on the project's Secrets tab (Add secret).
  2. Open the tool from Agent-created tools (pencil icon).
  3. Under Project secrets, either turn on Inject all project secrets, or pick specific ones in Secrets to inject (empty = none).
  4. In the tool code, read the value as an environment variable, for example os.environ["NAME"], using the secret's Name.
  5. Click Save.

Selected secrets are passed to the tool's sandbox as environment variables. The plain-text value never reaches the model. Inject only the secrets a tool actually needs.

Connect an external MCP server

If a system already offers an MCP (Model Context Protocol) server, connect it and the agent can use the tools it exposes. For systems without MCP, wrap their API as an agent-created tool instead.

  1. Open Tools & MCP and scroll to Connections ("Connect external tool servers over MCP — HTTP/SSE or stdio").
  2. Click Add server. Servers are listed on the left (use Search servers when there are many); the selected one is edited on the right.
  3. Optionally give it a Name. Names must be unique within the project; without one the server is shown by its address.
  4. In URL or Command, enter the server's URL (HTTP/SSE) or the command that starts it (stdio).
  5. Under Authentication, choose how Tensic signs in to the server:
    • None.
    • Bearer token: enter the Token; it is sent as Authorization: Bearer <token>.
    • API key in a header: enter the Header name and the Key.
    • Basic (user name and password): enter the User name and Password.
    • OAuth client credentials: enter the Token URL, Client ID and Client secret, and optionally Scope and Audience. Tensic fetches a token from the token URL and sends it as a bearer token. Secret values are encrypted at rest and shown masked afterwards.
  6. If the server needs other headers, open Custom headers (optional) and add one header per line in KEY: VALUE format.
  7. Click Test connection. Tensic contacts the server and reports connected with the number of tools it offers, or failed, with the reason when the server gives one. The server's row keeps the result, such as "connected · 3 tools · tested just now", and shows not tested until a test has run.
  8. After a successful test, Show the N tools lists what the server offers. To expose only some of them, pick them in Tools (leave empty for all).
  9. Click Save below the server list. Until then the entry is marked Unsaved.
  10. Test in Playground with a request that needs one of the server's tools.

Users who are not platform admins can only point a server at a public address; an admin can allow private addresses under Settings. MCP servers differ in how closely they follow the protocol, so test each new server with a few real requests before relying on it.

Connections section after Test connection: server entry showing connected with 3 tools, authentication and tool filter

Add a skill to an agent

A skill is a named, saved set of instructions: a procedure the agent loads only when it needs it. Only a short description is sent with every prompt; the full instructions cost no context until the agent loads them. Skills are text, saved and versioned in the project, not code.

  1. Open Tools & MCP > Behaviour > Built-in tools and add load_skill. Without it, skills are stored but the agent never sees them; the Skills section shows a warning with a Go to built-in tools button.
  2. Click Save.
  3. Scroll to Skills and click New skill.
  4. Fill in:
    • Name: letters, digits, spaces, hyphens and underscores. The model calls load_skill with this exact name.
    • Description: one line that reaches every prompt. Say when to use the skill. Only the first 200 characters are sent.
    • Instructions: the procedure itself (up to 100,000 characters).
  5. Click Save.

Saving shows "Skill created". The skill list shows each skill's Name, Description, Updated and an Enabled switch, plus a Publish to library button (to offer it to other projects through the instance's skills library), an edit (pencil) and a delete (bin) button. Turn Enabled off to keep a skill without letting the agent load it. Skills are added one at a time, or installed from the library when one has been published there. Once load_skill is bound, a request that matches a skill's description makes the agent call load_skill with the skill's name, and the Tool trace in Logs shows the call.

Write the description as a trigger ("Use when the user asks to…") so the agent knows when to load the skill.

New skill dialog with Name, Description and Instructions

Platform tools: write a tool once for every agent

The Tools page in the main menu (with a New platform tool button) has a Platform tools section and a Built-in tools section. Platform tools are small pieces of Python written once and offered to every agent project automatically, as opposed to an agent-created tool, which exists only inside the project that created it. When none exist, click Create the first platform tool, describe what you need in plain English, review the drafted code, run it in the sandbox and save it. Drafting uses the instance's system LLM. Built-in tools lists the 26 tools shipped with Tensic, grouped by category (for example Scheduled routines, Agent control, Communication, Web & search), says which ones use the sandbox and which need configuration (for example SMTP, Twilio, Telegram or WhatsApp setup), and notes that each project can add its own tools through MCP servers or create_tool.

Run code with the code interpreter and shell tools (inference projects)

Agent projects run code through the terminal tool in their own sandbox. Inference projects, which apps call through the OpenAI-compatible API, can run code too, through the Responses API (POST /projects/{id}/v1/responses) with the built-in code_interpreter or shell tool. Agent projects do not offer this endpoint.

  1. Call the Responses API of an inference project with a code_interpreter tool, for example "tools": [{"type": "code_interpreter", "container": {"type": "auto"}}]. The model writes Python, Tensic runs it in a container and the model answers from the result. The response contains the code (code_interpreter_call), the container_id, and, if the model reasons, a reasoning item.
  2. To reuse a container and its files, create one first with POST /projects/{id}/v1/containers (name, optional expires_after.minutes and memory_limit) and pass its ID: as container for the code interpreter, or as a container_reference environment for the shell tool. Containers have no network access.
  3. Delete containers you no longer need (DELETE /projects/{id}/v1/containers/{container_id}); idle containers expire on their own.

Platform admins see every container under Observability > Containers and set the limits in Settings (Containers API): the container image (a data-science image with pandas and matplotlib makes the interpreter more useful), the largest memory limit, how many containers may run at once (0 turns containers off), the longest idle expiry and an optional price per minute (0 records minutes without charging).

Common questions

Why doesn't the create_tool tool work on my agent?

It needs the terminal built-in tool as well. Add both under Built-in tools and save.

Can I change the code the agent wrote?

Yes. Open the tool under Agent-created tools with the pencil icon and edit the description, parameter schema or Python code.

How do I stop the agent using one of its tools?

Turn off Enabled for that tool under Agent-created tools. The tool is kept and can be re-enabled later.

Does the model see the API keys I inject into a tool?

No. Secrets are passed to the tool's sandbox as environment variables; the plain-text value never reaches the model.

How do I check that an MCP server works before the agent uses it?

Open the server entry under Connections and click Test connection. Tensic reports whether the server answered and how many tools it offers, or why it failed.

Can I connect an MCP server that needs a login?

Yes. Choose Bearer token, API key in a header, Basic or OAuth client credentials under Authentication. Secret values are stored encrypted.

The system I want to connect has no MCP server. What now?

Let the agent create a tool that calls the system's API, then review the code and inject the credentials as secrets.

My skills don't seem to be used. Why?

Add the load_skill built-in tool. Also check that each skill's Description says clearly when the skill should be used.

What is the difference between a project tool and a platform tool?

An agent-created (project) tool exists only in the project that made it. A platform tool is created once on the Tools page and is offered to every agent project.

Can an inference project run code?

Yes, through the Responses API with the code_interpreter or shell tool. The code runs in a container without network access, and the container minutes show under Observability > Containers.

What is the difference between a tool and a skill?

A tool runs code and returns a result. A skill is text instructions that the agent reads when it decides the skill is relevant.