BUILD WITH TOOLS

Tools

Give AI access to focused, typed operations in your .NET application.

A tool is a C# operation with a name, description, typed input, and typed output. An agent can request an attached tool; your application executes it and returns the result.

Use tools to query application data, perform calculations, or invoke services. Keep validation, authorization, and business rules in the application code that performs the operation.

What defines a tool

PartPurpose
Metadata[RuniqTool] supplies the model-facing name and description.
InputA typed model describes the arguments the operation accepts.
ExecutionIRuniqTool<TInput, TOutput>.ExecuteAsync implements the operation.
OutputA typed result is serialized to JSON.
RegistrationAttach the tool to an agent or register it for direct Studio testing.

A description helps the model choose a tool. It does not enforce permissions or validate business rules.

From request to result

  1. The runtime sends the agent's attached tool schemas to the model.
  2. The model can request a tool using its registered name and JSON arguments.
  3. Runiq binds the input, creates the tool through dependency injection, and calls its implementation.
  4. The output returns to the model for continuation. Studio can show the call and its result.

Attaching a tool makes it available; it does not guarantee the model will call it.

Start with a small operation

The guides use TextStatsTool, a local calculation that counts text characters and whitespace-separated words. It requires no external service or model key when tested directly.

Define the tool →

Create a complete typed contract and implementation.

Attach it to an agent →

Make the operation available to the Support Agent from the Agents guides.

Test it in Studio →

Check the contract and output before testing model-driven calls.

Tools, RAG, and MCP

CapabilityUse it for
ToolsExecute application operations.
RAGRetrieve document passages to support an answer.
MCPExpose capabilities to compatible clients through a protocol.

An agent tool is not automatically exposed as an MCP server tool. Follow the MCP guide for that registration path.

On this page