Skip to content

Confusing parameter/property names in Azure.AI.Agents.Persistent.MCPApproval #53000

@stephentoub

Description

@stephentoub

The MCPApproval class has a constructor:

/// <param name="trust">The trust level, can be "always" or "never"</param>
public MCPApproval(string trust)

I read that "trust" parameter being "always" or "never" as meaning whether to always trust a tool or never trust a tool. But it's the opposite. "always" here maps to approval always being required, and "never" maps to approval never being required, which is the opposite of the tool "always" being trusted or "never" being trusted, as highlighted by the subsequent properties:
/// <summary>
/// Return true if we do not trust all tool and always need to ask for approval before sending data to server.
/// </summary>
public bool AlwaysApprove{get => string.Equals(_forAllToolsApproval, ALWAYS);}
/// <summary>
/// Return true if we trust all tools and do not need to ask for approval before before sending data to server.
/// </summary>
public bool NeverApprove { get => string.Equals(_forAllToolsApproval, NEVER); }

This parameter should be renamed, e.g. "requireApproval".

I suggest those properties should also be renamed. "AlwaysApprove" reads different to me than "AlwaysRequireApproval"; the former sounds like it's saying the system should always automatically approve of any tool calls, but that's the opposite of which it actually means, which is that all tool calls require approval.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI AgentsClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions