agui-dotnet-server-tools

agui-dotnet-server-tools is a skill for Claude Code from ag-ui-protocol/ag-ui. It costs 202 tokens per session (1,392 once invoked), scanned A, original, MIT.

A guide for exposing backend C# functions as tools an AG-UI agent can call. The server runs the function and sends its result back to the model, so the client does not need to execute tool code.

In plain words
What is it for?
Use it to define and register server-side functions such as restaurant searches, then let the agent call them through an AG-UI .NET chat client.
Why use it?
It keeps sensitive or server-owned work on the backend while allowing the agent to request it during a conversation. The run can continue after the function returns.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ag-ui-dotnet plugin — 9 skills shipped together

Good fit Use it to define and register server-side functions such as restaurant searches…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ag-ui-protocol/ag-ui/agui-dotnet-server-tools
About the project

AG-UI is an event-based protocol that lets AI agent backends communicate with user-facing applications. It standardizes agent events and inputs while supporting transports such as server-sent events, WebSockets, and webhooks. The catalogue add-ons help developers build integrations and applications around the protocol.

ag-ui-protocol/ag-ui · 15,743 stars · on GitHub · ag-ui.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ag-ui-protocol/ag-ui --skill agui-dotnet-server-tools
Clone the repo
git clone --depth 1 https://github.com/ag-ui-protocol/ag-ui

Made for: Claude Code.

Or install ag-ui-dotnet, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agui-dotnet-server-tools

README.md
[![agentmods](https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-server-tools.svg)](https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-server-tools)
Your own site
<a href="https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-server-tools"><img src="https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-server-tools.svg" alt="Measured on agentmods" height="20"></a>
Per session 202 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,392 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00202 $0.01392
Opus 5 $0.00101 $0.00696
Sonnet 5 $0.00040 $0.00278
Haiku 4.5 $0.00020 $0.00139

Measured 7d ago against content hash 18060f232c39, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agui-dotnet-server-tools scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sdks/dotnet/plugins/ag-ui-dotnet/skills/agui-dotnet-server-tools/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AG-UI .NET — server (backend) tools

Goal: let the model call a C# function that runs on your server, with the server executing the call and returning the result so the run continues to a final answer.

A server tool is an ordinary Microsoft.Extensions.AI AIFunction registered on the server's IChatClient. The FunctionInvokingChatClient executes it inside the run; the client sends no tools and needs no tool code, and receives the final answer. Tool-call and result events still cross the wire — the client just never executes anything.

Install

dotnet add package AGUI.Server
dotnet add package AGUI.Formatting

Microsoft.Extensions.AI supplies AIFunctionFactory, AddChatClient, and UseFunctionInvocation. Run dotnet package search AGUI.Server --exact-match for the current version.

Define and register a tool

Create the function with AIFunctionFactory.Create, add it to the chat client's tools, and enable function invocation:

using System.ComponentModel;
using Microsoft.Extensions.AI;

[Description("Search for restaurants in a location.")]
static RestaurantSearchResponse SearchRestaurants(
    [Description("Where to search and what cuisine.")] RestaurantSearchRequest request)
{
    // ... real lookup ...
}

var builder = WebApplication.CreateBuilder(args);

var searchRestaurants = AIFunctionFactory.Create(
    SearchRestaurants,
    serializerOptions: SampleJsonSerializerContext.Default.Options);

builder.Services.AddChatClient(
        new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
            .GetChatClient(deploymentName)
            .AsIChatClient())
    .ConfigureOptions(o => (o.Tools ??= []).Add(searchRestaurants))
    .UseFunctionInvocation(fic => fic.TerminateOnUnknownCalls = true);

The [Description] attributes become the tool and parameter schema the model sees. Any Microsoft.Extensions.AI provider works in place of Azure OpenAI.

AOT-safe tool arguments and results

When a tool takes or returns a complex type (anything beyond primitives), its schema and (de)serialization must be source-generated, not reflection-based. Put the parameter and result types in a JsonSerializerContext, register it on the host's JSON options, and pass it to AIFunctionFactory.Create:

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 132 lines · 202 tokens per session scan A 18060f232c39

Subscribe to this mod's changes

agui-dotnet-server-tools is a skill published in the GitHub repository ag-ui-protocol/ag-ui (15,743 stars, last pushed 2d ago), licensed MIT. It adds 202 tokens to every session and 1,392 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.