Skip to content

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

Draft
josemontespg wants to merge 1 commit into
catalogs-mcp-json-functionsfrom
catalogs-mcp-transform-data
Draft

josemontespg wants to merge 1 commit into
catalogs-mcp-json-functionsfrom
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 Outdated
@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

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