Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Azure.DataApiBuilder.Mcp/BuiltInTools/ExecuteEntityTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,16 @@ private static bool TryParseExecuteArguments(
entity = entityElement.GetString() ?? string.Empty;

// Extract parameters if provided (optional)
if (rootElement.TryGetProperty("parameters", out JsonElement parametersElement) &&
parametersElement.ValueKind == JsonValueKind.Object)
if (rootElement.TryGetProperty("arguments", out JsonElement argumentsElement) &&
argumentsElement.ValueKind == JsonValueKind.Object)
{
foreach (JsonProperty property in argumentsElement.EnumerateObject())
{
parameters[property.Name] = GetParameterValue(property.Value);
}
}
else if (rootElement.TryGetProperty("parameters", out JsonElement parametersElement) &&
parametersElement.ValueKind == JsonValueKind.Object)
{
foreach (JsonProperty property in parametersElement.EnumerateObject())
{
Expand Down
30 changes: 30 additions & 0 deletions src/Azure.DataApiBuilder.Mcp/Core/McpProtocolDefaults.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.Extensions.Configuration;

namespace Azure.DataApiBuilder.Mcp.Core
{
/// <summary>
/// Centralized defaults and configuration keys for MCP protocol settings.
/// </summary>
public static class McpProtocolDefaults
{
/// <summary>
/// Default MCP protocol version advertised when no configuration override is provided.
/// </summary>
public const string DEFAULT_PROTOCOL_VERSION = "2025-06-18";

/// <summary>
/// Configuration key used to override the MCP protocol version.
/// </summary>
public const string PROTOCOL_VERSION_CONFIG_KEY = "MCP:ProtocolVersion";

/// <summary>
/// Helper to resolve the effective protocol version from configuration.
/// Falls back to <see cref="DEFAULT_PROTOCOL_VERSION"/> when the key is not set.
/// </summary>
public static string ResolveProtocolVersion(IConfiguration? configuration)
{
return configuration?.GetValue<string>(PROTOCOL_VERSION_CONFIG_KEY) ?? DEFAULT_PROTOCOL_VERSION;
}
}
}

Loading