Skip to content

Align successful response for built-in mcp tools to all use the mcp utility function #2919

@aaronburtle

Description

@aaronburtle

in read we are calling a private BuildSuccessfulResult which is hard coding the response dictionary to use "status", and "result" as keys.


        private static CallToolResult BuildSuccessResult(
            string entityName,
            JsonElement engineRootElement,
            ILogger? logger)
        {
            // Build normalized response
            Dictionary<string, object?> normalized = new()
            {
                ["status"] = "success",
                ["result"] = engineRootElement // only requested values
            };

Then in delete we are using the built in helper from the mcp response builder and using "entity", "keyDetails", and "message"


               Dictionary<string, object?> responseData = new()
               {
                   ["entity"] = entityName,
                   ["keyDetails"] = McpJsonHelper.FormatKeyDetails(keys),
                   ["message"] = "Record deleted successfully"
               };


Update is using a private function like read is, create is aligned with delete, using the utility with "entity", and "message".

we should have all these use the mcp response helper and try to use the same keys in the response data.

Metadata

Metadata

Assignees

Type

Projects

Status

Review In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions