Skip to content

Ensure MCP tool outputs are always objects#942

Merged
jviotti merged 3 commits into
mainfrom
tool-response-objects
May 25, 2026
Merged

Ensure MCP tool outputs are always objects#942
jviotti merged 3 commits into
mainfrom
tool-response-objects

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented May 25, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 13 files

Re-trigger cubic

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 25, 2026

🤖 Augment PR Summary

Summary: This PR updates MCP tool call responses so that structuredContent is always a JSON object (instead of sometimes returning a bare array), aligning behavior with the MCP spec.

Changes:

  • Wrap dependency-tree tool outputs in an object envelope with a results array (ActionDependencyTree_v1).
  • Wrap schema-search tool outputs similarly, and update resource-link generation to read from results (ActionSchemaSearch_v1).
  • Update enterprise Hurl E2E assertions/captures to expect structuredContent.results and to parse the text payload as an object with results.
  • Adjust expected schema resource sizes in resources listings.
  • Tighten the MCP tools/call response schema to require structuredContent (when present) to be an object, with an MCP-spec reference comment.

Technical Notes: The returned text block now represents the prettified envelope object (e.g., {"results": [...]}), matching the new structured payload shape.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

jsonpath "$.result.structuredContent" count == 0
variable "text" jsonpath "$" count == 0
jsonpath "$.result.structuredContent.results" count == 0
variable "text" jsonpath "$.results" count == 0
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 25, 2026

Choose a reason for hiding this comment

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

jsonpath "$.result.structuredContent.results" count == 0 will also pass if structuredContent is omitted entirely; if the intent is to enforce the new always-object envelope, consider also asserting that structuredContent (and .results) exists so this test catches regressions.

Severity: low

Other Locations
  • enterprise/e2e/html/hurl/mcp-2025-11-25-get_schema_dependencies.all.hurl:69
  • enterprise/e2e/html/hurl/mcp-2025-11-25-get_schema_dependencies.all.hurl:501
  • enterprise/e2e/html/hurl/mcp-2025-11-25-get_schema_dependencies.all.hurl:785
  • enterprise/e2e/html/hurl/mcp-2025-11-25-get_schema_dependents.all.hurl:30
  • enterprise/e2e/html/hurl/mcp-2025-11-25-search_schemas.all.hurl:357

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

jviotti added 2 commits May 25, 2026 08:59
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: ed73d28 Previous: 0d03c9c Ratio
Add one schema (0 existing) 244 ms 292 ms 0.84
Add one schema (100 existing) 19 ms 25 ms 0.76
Add one schema (1000 existing) 64 ms 81 ms 0.79
Add one schema (10000 existing) 869 ms 872 ms 1.00
Update one schema (1 existing) 13 ms 18 ms 0.72
Update one schema (101 existing) 20 ms 26 ms 0.77
Update one schema (1001 existing) 63 ms 80 ms 0.79
Update one schema (10001 existing) 536 ms 662 ms 0.81
Cached rebuild (1 existing) 3 ms 5 ms 0.60
Cached rebuild (101 existing) 5 ms 7 ms 0.71
Cached rebuild (1001 existing) 18 ms 28 ms 0.64
Cached rebuild (10001 existing) 158 ms 258 ms 0.61
Index 100 schemas 86 ms 118 ms 0.73
Index 1000 schemas 687 ms 906 ms 0.76
Index 10000 schemas 10488 ms 13672 ms 0.77

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: ed73d28 Previous: 0d03c9c Ratio
Add one schema (0 existing) 300 ms 294 ms 1.02
Add one schema (100 existing) 29 ms 31 ms 0.94
Add one schema (1000 existing) 85 ms 91 ms 0.93
Add one schema (10000 existing) 693 ms 719 ms 0.96
Update one schema (1 existing) 21 ms 23 ms 0.91
Update one schema (101 existing) 28 ms 31 ms 0.90
Update one schema (1001 existing) 85 ms 91 ms 0.93
Update one schema (10001 existing) 701 ms 724 ms 0.97
Cached rebuild (1 existing) 7 ms 7 ms 1
Cached rebuild (101 existing) 9 ms 10 ms 0.90
Cached rebuild (1001 existing) 31 ms 35 ms 0.89
Cached rebuild (10001 existing) 274 ms 282 ms 0.97
Index 100 schemas 143 ms 126 ms 1.13
Index 1000 schemas 1109 ms 1082 ms 1.02
Index 10000 schemas 13790 ms 13501 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit 4823835 into main May 25, 2026
5 checks passed
@jviotti jviotti deleted the tool-response-objects branch May 25, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant