Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
RoundedDoubleArrayConverter.cs1.36 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Text.Json.Serialization; namespace AzureMcp.Monitor.Models { /// <summary> /// Custom JSON converter that rounds double arrays to 2 decimal places /// </summary> public class RoundedDoubleArrayConverter : JsonConverter<double[]?> { public override double[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.Null) return null; var list = new List<double>(); if (reader.TokenType == JsonTokenType.StartArray) { while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) { list.Add(reader.GetDouble()); } } return [.. list]; } public override void Write(Utf8JsonWriter writer, double[]? value, JsonSerializerOptions options) { if (value == null) { writer.WriteNullValue(); return; } writer.WriteStartArray(); foreach (var item in value) { writer.WriteNumberValue(Math.Round(item, 2)); } writer.WriteEndArray(); } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Azure/azure-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server