Skip to content
Context Windowby Alex Janjic
Menu

Working code for AI systems, clear diagrams, and the parts that only show up in production.

contextwindow.us/posts/when-the-tool-catalog-becomes-the-promptFeatured

When the tool catalog becomes the prompt

A 192-run Microsoft.Extensions.AI benchmark compares sending 8 or 64 tools on every request with a RequestTools discovery function. At 64 tools, billed tokens drop by about 2.5x. At 8 tools, the extra round trip costs more than it saves.

AI systemsReliability
Read the article
examples/ProgressiveCatalogUsage.cs
ToolCatalog catalog = new ToolCatalogBuilder()
    .AddTool("github", githubSearch)
    .AddTool("jira", jiraSearch)
    .AddTool("database", queryDatabase, tags: ["sql", "postgres"])
    .Build();

AIFunction requestTools = catalog.CreateRequestToolsFunction();

Register the catalog in process. Put RequestTools on the request. Attach matches during the function loop.

Latest

New notes and rewrites, newest first.

All articles

Code behind the writing

The exact repositories behind the articles, with a clear place to start.

All projects
CsharpMaintained

alex-janjic/ContextWindow.Extensions.AI

A progressive tool catalog for Microsoft.Extensions.AI with deterministic selection, compatibility tests, and benchmark suites.

examples/ProgressiveCatalogUsage.csStart here

Follow without another inbox

RSS carries every article and correction. No account, tracking pixel, or algorithm.

Open the RSS feed