Inference Logoinference.sh

Adding Tools

Tools extend what your agent can do. There are seven types of tools.


Tool Types

TypeWhat it isUse case
AppAny app from the gridImage generation, search, transcription
AgentAnother agentDelegate specialized tasks
ConnectorMCP server toolLinear, Slack, GitHub, Google
CallHTTP API callREST APIs, external services
HookExternal webhookConnect to your own services
ClientCode-executed toolsBrowser automation, custom logic
InternalBuilt-in agent capabilitiesMemory, planning, widgets

All tools are managed in one place: the Tools tab.


Adding an App Tool

  1. Open your agent's settings
  2. Go to the Tools tab
  3. Click Add ToolApp Tool
  4. Search and select an app

The agent can now call this app.

What happens automatically:

  • Name is extracted from the app
  • Input schema becomes tool parameters
  • You can customize the description shown to the agent

Configuring Setup & Default Inputs

App tools support two types of pre-configuration:

SettingPurposeWhen it's used
SetupOne-time configuration valuesPassed to the app on every call (e.g., API keys, model selection)
Default InputsDefault parameter valuesMerged with agent's call — agent can override these

To configure:

  1. After adding an app tool, click Configure Setup or Configure Default Inputs
  2. Fill in the form fields
  3. Save the agent

Example: An image generation tool might have:

  • Setup: API key, default model, safety settings
  • Default Inputs: Default resolution, style preset

The agent only sees input parameters — setup values are hidden from the LLM.


Adding an Agent Tool

Agents can delegate to other agents:

  1. Go to Tools tab
  2. Click Add ToolAgent Tool
  3. Select another agent

The main agent can now delegate tasks to it.

code
1Main Agent2 Research Agent (gathers information)3 Writing Agent (creates content)4 Editor Agent (reviews and polishes)

See Sub-Agents for more details.


Adding a Webhook Tool

Connect your agent to external services:

  1. Go to Tools tab
  2. Click Add ToolWebhook Tool
  3. Enter a name and webhook URL
  4. Optionally add a secret and input schema

When called, the hook receives:

  • Tool arguments
  • A callback URL to return results

See Webhooks for implementation details.


Adding a Connector Tool

Connector tools call tools on MCP servers you've connected to — Linear, Slack, GitHub, and more.

  1. Go to Tools tab
  2. Click Add ToolConnector Tool
  3. Select a connected MCP server
  4. Choose which tools to expose

The agent sees each tool with its name and description. Authentication is handled automatically at runtime.

yaml
1tools:2  - name: list_issues3    type: mcp4    description: List Linear issues5    mcp:6      integration_id: "integ_abc123"7      tool_name: "list_issues"

See Connectors for full documentation.


Adding a Call Tool

Call tools make HTTP requests to external APIs. Unlike webhooks, call tools execute directly — the agent sends a request and gets the response back immediately.

  1. Go to Tools tab
  2. Click Add ToolCall Tool
  3. Configure the tool:
FieldDescription
NameTool name the agent sees (e.g. get_weather)
DescriptionWhat the tool does — helps the agent decide when to use it
URLThe endpoint to call (supports {{context.X}} templates)
MethodHTTP method (GET, POST, PUT, DELETE)
Input SchemaJSON Schema for the tool's parameters — becomes the request body

Authentication

Call tools support multiple auth methods. Credentials are injected at runtime — never exposed to the agent.

Auth TypeHow it works
BearerSends Authorization: Bearer <value> using a team secret
API KeySends a header with a team secret value
IntegrationUses a configured OAuth integration
NoneNo authentication

Bearer auth is the most common. Set it up:

  1. Store your API key as a team secret: belt secrets set my_api_key sk-xxx
  2. In the tool config, set auth type to Bearer and reference the secret name
yaml
1auth:2  type: bearer3  secret: my_api_key

Context Templates

URLs can include {{context.X}} placeholders that resolve from per-chat context values. This lets one agent definition work across different resources.

code
1https://api.example.com/projects/{{context.project_id}}/tasks

When starting a chat, pass context values:

json
1{2  "agent_id": "agent_abc123",3  "context": {4    "project_id": "proj_456"5  }6}

Context is set once per chat and cannot change. See Context below.

Require Approval

For destructive or expensive operations, enable Require Approval. The agent pauses and waits for user confirmation before calling the tool.


Context

Context provides per-chat variables that get resolved in call tool URLs. Declare the fields your agent expects, then pass values when creating a chat.

Declaring Context Fields

In the agent config, declare what context the agent needs:

yaml
1context:2  - name: project_id3    description: The project to operate on4    required: true5  - name: environment6    description: Target environment (staging or production)7    required: false

Passing Context

Context values are passed when creating a chat or running an agent:

REST API:

json
1{2  "agent_id": "agent_abc123",3  "context": {4    "project_id": "proj_456",5    "environment": "staging"6  }7}

Belt CLI:

bash
1belt agent run myteam/my-agent "do the thing" \2  --context project_id=proj_456 \3  --context environment=staging

Context is immutable — once set on a chat, it cannot change. This ensures all tool calls within a conversation operate on the same resource.

Context values also appear in the agent's system prompt as a ## Context section, so the agent knows what it's working with.


Client Tools

Client tools execute in your application code. They're defined with a handler function that runs when the agent calls the tool.

typescript
1import { tool, string } from '@inferencesh/sdk'23const myTool = tool('search_ui')4  .describe('Scans the UI for interactive elements')5  .param('query', string('Search query'))6  .handler(async (args) => {7    // Your code runs here8    return JSON.stringify({ results: [...] })9  })

Client tools are useful for:

  • Browser automation (DOM interaction)
  • Accessing local resources
  • Custom business logic
  • Integrating with frontend frameworks

Internal Tools

Internal tools are built-in capabilities provided by the runtime. They're automatically available based on agent configuration.

Plan Tools

Task planning for complex multi-step operations:

ToolDescription
plan_createCreate a plan with steps
plan_updateUpdate step status
plan_loadView current plan

Memory Tools

Key-value storage that persists across messages:

ToolDescription
memory_setStore a value
memory_getRetrieve a value
memory_getallGet all stored memories

Widget Tool

UI rendering for interactive forms (top-level agents only):

ToolDescription
widgetCreate forms, buttons, cards

Finish Tool

For agents to report structured output:

ToolDescription
finishReport status and results

When output_schema is set on the agent config, the finish tool validates results against the schema. See Structured Output for details.

Skills Tool

Load skill content on-demand (when agent has skills defined):

ToolDescription
skill_getRetrieve a skill's full content

See Skills for more details on defining and using skills.


Example App Tools

ToolWhat it does
stable-diffusionGenerate images
whisperTranscribe audio
summarizeCondense text
web-searchSearch the internet

How Agents Use Tools

When you chat:

code
1You: Generate a sunset image23Agent: I'll create that for you.4       [Calling stable-diffusion with prompt "sunset"]56       Here's your sunset image!

The agent decides when to use which tool based on your request.


Tool Descriptions

Each tool has a description that tells the agent what it does. Good descriptions help the agent choose the right tool:

Generic:

code
1Search the web

Better:

code
1Search the web for current information. Use when you need up-to-date2facts, news, or information not in your training data.

Next

Sub-Agents

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.