microsoft / microsoft/agent-framework

.NET: Support programmatic parameter descriptions in AIFunctionFactory

Open
#1,864 5 comments 1 reaction 1 assignee View on GitHub

@stephentoub is already working on this.

Since Dec 3, 2025.

.NET question
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Hello,

I have an issue regarding tool definitions.

AIFunctionFactory.Create cannot set parameter descriptions programmatically. It must use [Description] attributes in code, preventing external configuration.

Right now, parameter descriptions can only come from [Description] attributes in code:

public async Task<string> SearchAsync(
    [Description("The search query")]  // Must be in code
    string query
)

This means every time I want to tweak a parameter description to improve tool selection, I need to deploy new code. For comparison, I can already set the function name and description externally via AIFunctionFactoryOptions, but there's no equivalent for parameters.

Right now I'm stuck with a hybrid approach (function descriptions external, parameter descriptions in code), but it would be great to have consistency.

Let me know if you need any clarification or if there's a workaround I missed :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.