Repository navigation
feat(catalog-mcp): add the MCP JSON tool result example - #3729
Open
josemontespg wants to merge 1 commit into
Open
josemontespg wants to merge 1 commit into
josemontespg wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new example file mcp-json-tool-result.json that demonstrates two ways to load and handle headless MCP tool results: by chaining data functions (callMcpTool, transformData, and updateDataModel) or by utilizing targetDataPath. The documentation in both the main and TypeScript catalog READMEs has been updated to reference this example, and corresponding unit tests have been added to catalog.test.ts. Feedback on the changes suggests improving the robustness of the mock MCP client in the tests by using optional chaining to safely handle potentially undefined request parameters.
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 28, 2026 22:45
d1fd202 to
59348df
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 28, 2026 22:49
59348df to
d92c61d
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 28, 2026 23:21
d92c61d to
d551bc8
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 28, 2026 23:42
d551bc8 to
56599ad
Compare
josemontespg
changed the base branch from
catalogs-mcp-json-functions
to
catalogs-mcp-transform-data
October 29, 2026 00:22
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 29, 2026 00:26
56599ad to
7c47873
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 29, 2026 01:01
7c47873 to
4f9712f
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 29, 2026 17:15
4f9712f to
6987b54
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 29, 2026 17:36
6987b54 to
0a205d4
Compare
josemontespg
marked this pull request as ready for review
October 29, 2026 17:44
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 29, 2026 18:28
0a205d4 to
4348a62
Compare
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 30, 2026 20:57
4348a62 to
f783e1c
Compare
mcp-json-tool-result.json loads the open issues of a repository from a headless list_issues tool. One button chains callMcpTool, transformData and updateDataModel to fill a template list from the json of the payload, and a second button writes the payload to targetDataPath and binds a list to its structuredContent. catalog.test.ts runs both actions against a mock client, and both READMEs point at the example.
josemontespg
force-pushed
the
catalogs-mcp-json-example
branch
from
October 30, 2026 21:41
f783e1c to
9117d22
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
catalogs/mcp/v1/examples/mcp-json-tool-result.json, a message sequence that loads the open issues of a repository from a headlesslist_issuestool, next to the basic catalog. One button chainscallMcpTool,transformDataandupdateDataModelto fill a template list from thejsonof the payload; a second button only setstargetDataPathand binds a list to thestructuredContentof the payload written there.catalog.test.tsprocesses the example with a mock client that returns the issues both as JSON text and as structured content, runs both button actions throughDataContext.resolveAction, and checks the data model after each. Both READMEs now point at the example from the sections that use its actions.Changes
catalogs/mcp/v1/examples/mcp-json-tool-result.json: the example surface, withload_button(chained functions into/issues) andload_all_button(targetDataPath: "/issueResponse").typescript/catalogs/mcp/src/catalog.test.ts:createToolClientandactionOfhelpers and three cases: the example processes next to the basic catalog, the first action writes the shaped issues to/issues, the second writes the payload to/issueResponse.catalogs/mcp/README.md: list the example and reference its two buttons from the data functions section.typescript/catalogs/mcp/README.md: link the example from "Shape a headless tool result".Verification
yarn workspace @a2ui/catalog-mcp run test: node and karma suites pass, including the three newthe JSON tool result examplecases.specification/v1_0/test/run_tests.pyvalidates the example against the v1 MCP and basic catalogs;./scripts/fix_format.sh --checkpasses.