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
| Part | Purpose |
|---|---|
| Metadata | [RuniqTool] supplies the model-facing name and description. |
| Input | A typed model describes the arguments the operation accepts. |
| Execution | IRuniqTool<TInput, TOutput>.ExecuteAsync implements the operation. |
| Output | A typed result is serialized to JSON. |
| Registration | Attach 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
- The runtime sends the agent's attached tool schemas to the model.
- The model can request a tool using its registered name and JSON arguments.
- Runiq binds the input, creates the tool through dependency injection, and calls its implementation.
- 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.
Create a complete typed contract and implementation.
Make the operation available to the Support Agent from the Agents guides.
Check the contract and output before testing model-driven calls.
Tools, RAG, and MCP
| Capability | Use it for |
|---|---|
| Tools | Execute application operations. |
| RAG | Retrieve document passages to support an answer. |
| MCP | Expose 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.