ToolsAttaching tools

Attaching tools

Attach typed tools to agents or register them for the dashboard tool playground.

An agent cannot use a tool unless the tool is attached to that agent.

Attach a tool to an agent

C#
using Runiq.Agents;
using Runiq.Agents.Tools;

var weatherAgent = new Agent(
    id: "weather-agent",
    name: "Weather Agent",
    instructions: """
    You are the Weather Analyst in a deterministic travel planning workflow.

    Always use WeatherTool when the request involves a city or trip plan.
    Return only the weather and comfort contribution for the planner.
    Do not create the final itinerary.
    """,
    model: "openai/gpt-5",
    apiKey: builder.Configuration["OpenAI:ApiKey"])
    .AddTool<WeatherTool>();

builder.Services.AddRuniqServer(options =>
{
    options.AddAgent(weatherAgent);
});

AddTool<TTool>() on an Agent gives that agent permission to use the tool. A tool attached to Weather Agent is not automatically available to Planner Agent.

This is intentional. Tool access is part of the agent boundary.

Register a standalone tool

RuniqServerOptions.AddTool<TTool>() registers a tool with the runtime tool registry without attaching it to an agent.

C#
builder.Services.AddRuniqServer(options =>
{
    options.AddTool<ServerTimeTool>();
});

Use this when you want the tool visible and runnable through the dashboard tool playground, but not automatically available to any agent.

To let an agent call it, attach it to that agent with .AddTool<ServerTimeTool>().

Attached vs standalone

RegistrationAvailable to agentsVisible in tool metadata
agent.AddTool<TTool>()Yes, for that agent only.Yes.
options.AddTool<TTool>()No, unless also attached to an agent.Yes.

This lets you test tools directly in the dashboard before exposing them to an agent.

Capability boundaries

Attach only the capabilities the agent should be allowed to use.

AgentAttached tools
Weather AgentWeatherTool
Places AgentPlacesTool
Planner AgentMealSuggestionTool

This is easier to debug than giving every agent every tool.

When an agent produces an unexpected answer, the dashboard can show whether it had the right tools, called the right one, and passed the right input.

On this page