Skip to content

feat(catalog-mcp): add transformData - #3736

Open
josemontespg wants to merge 1 commit into
catalogs-mcp-tool-payloadfrom
catalogs-mcp-transform-data
Open

josemontespg wants to merge 1 commit into
catalogs-mcp-tool-payloadfrom
catalogs-mcp-transform-data

Conversation

@josemontespg

Copy link
Copy Markdown
Collaborator

Summary

Adds the transformData data function to the v1 MCP catalog and @a2ui/catalog-mcp. transformData evaluates a standard JMESPath expression, passed in its jmespath argument, against data, letting a surface select, filter, and reshape fields from a callMcpTool payload into the {path: value} object that updateDataModel writes.

transformData is declared in catalogs/mcp/v1/catalog.json, registered on mcpCatalog, and exported as TransformDataApi and TransformDataImplementation. It implements standard JMESPath with no extensions, raises an A2uiExpressionError when an expression fails to parse (Invalid JMESPath expression: ...) or evaluate, and treats @path or @call objects inside data as plain data rather than expressions.

Changes

  • typescript/catalogs/mcp/src/functions/transform_data.ts and transform_data.test.ts: implement TransformDataApi and TransformDataImplementation with unit and JMESPath compliance tests.
  • typescript/catalogs/mcp/src/catalog.ts and src/index.ts: register TransformDataImplementation on mcpCatalog and export TransformDataApi and TransformDataImplementation.
  • catalogs/mcp/v1/catalog.json and typescript/catalogs/mcp/src/catalog.test.ts: declare transformData with links to the JMESPath specification and check parity with mcpCatalog.
  • typescript/catalogs/mcp/package.json and yarn.lock: add jmespath and @types/jmespath.
  • catalogs/mcp/README.md, typescript/catalogs/mcp/README.md, CHANGELOG.md: document transformData and how updateDataModel(transformData(callMcpTool(...))) chains settle async tool results.

Verification

  • yarn workspace @a2ui/catalog-mcp run test and yarn workspace @a2ui/catalog-mcp run lint: node and karma suites pass, including transform_data.test.ts and the callMcpTool.test.ts payload chaining case.
  • specification/v1_0/test/run_tests.py and ./scripts/fix_format.sh --check pass.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the transformData function to the A2UI MCP catalog, allowing surfaces to evaluate standard JMESPath expressions against tool results to shape them into data model updates. The changes include the implementation of the function, schema updates, comprehensive unit tests, and documentation. The reviewer pointed out that the placeholder [#NNNN] in the changelog should be replaced with the actual pull request number before merging.

Comment thread typescript/catalogs/mcp/CHANGELOG.md Resolved
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from faa5e32 to 5d6f545 Compare October 29, 2026 00:26
@josemontespg
josemontespg added this pull request to stack #3737 October 29, 2026 00:28
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from 5d6f545 to d1bce65 Compare October 29, 2026 00:59
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from d1bce65 to d7eeb88 Compare October 29, 2026 17:15
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from d7eeb88 to 2780f69 Compare October 29, 2026 17:36
@josemontespg
josemontespg requested a review from ditman October 29, 2026 17:41
@josemontespg
josemontespg marked this pull request as ready for review October 29, 2026 17:41
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from 2780f69 to 0e13e8a Compare October 29, 2026 18:28
@josemontespg
josemontespg removed this pull request from stack #3737 October 30, 2026 20:56
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from 0e13e8a to 980dbdc Compare October 30, 2026 20:57
@josemontespg
josemontespg changed the base branch from catalogs-mcp-json-functions to catalogs-mcp-tool-payload October 30, 2026 20:58
@josemontespg
josemontespg added this pull request to stack #3796 October 30, 2026 20:58
@josemontespg
josemontespg force-pushed the catalogs-mcp-transform-data branch from 980dbdc to 2698d8a Compare October 30, 2026 21:41
@josemontespg
josemontespg removed this pull request from stack #3796 October 30, 2026 21:43
@josemontespg
josemontespg added this pull request to stack #3797 October 30, 2026 21:43

This branch has not been deployed

No deployments
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