Skip to content

Conversation

@prvavill
Copy link
Contributor

@prvavill prvavill commented Sep 25, 2025

What does this PR do?

when required parameter is not provided get cluster details tool, client sees error and the error info does not clearly say which parameter is missing

GitHub issue number?

#549

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances parameter validation by providing parameter names in exception messages. It adds a new overloaded method ValidateRequiredParameters that accepts named parameters as tuples, allowing for more descriptive error messages that include the parameter name when validation fails.

Key changes:

  • Added overloaded ValidateRequiredParameters method that accepts named parameters as tuples
  • Updated all ValidateRequiredParameters calls in KustoService to use the new named parameter format

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs Added new overloaded ValidateRequiredParameters method that accepts named parameters and provides parameter names in exception messages
tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs Updated all ValidateRequiredParameters calls to use the new named parameter format with nameof() operator

@vcolin7 vcolin7 changed the title Handling missing param name exception with parameter name Improve error message for missing parameters in Kusto commands Sep 26, 2025
@vcolin7 vcolin7 merged commit fe20a6b into main Sep 26, 2025
26 of 27 checks passed
@vcolin7 vcolin7 deleted the user/prvavill/handle_missing_param_name branch September 26, 2025 00:38
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure MCP Server Sep 26, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
…soft#575)

* Handling missing param name exception with parameter name

* Update core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs

Co-authored-by: Copilot <[email protected]>

* fix to throw all missing params at once

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants