Skip to content

[transforms] Add a transform pipeline for the tool catalog : Issue #61 - #86

Open
Shreyavemana wants to merge 3 commits into
nitrocloudofficial:developfrom
Shreyavemana:feat/61-transform-pipeline
Open

Shreyavemana wants to merge 3 commits into
nitrocloudofficial:developfrom
Shreyavemana:feat/61-transform-pipeline

Conversation

@Shreyavemana

Copy link
Copy Markdown
Collaborator

Summary

Adds a transform pipeline for the tool catalog, allowing tools/list and tools/call to be rewritten through an ordered chain of transforms. Closes #61.

Changes

  • Added the nitrostack/transforms/ package with McpTransform, McpTransformBase, CatalogTransform, TransformPipeline, and TransformContext.
  • Added @mcp_app(transforms=[...]) support. List transforms execute in declared order, and resolve_tool supports chaining through next.
  • Added re-entrancy support: a synthetic tool can call a real tool through ctx.call_tool(..., caller=name). The issuing transform is skipped, while guards and argument validation are applied to the real tool.
  • Unified argument validation through validate_tool_arguments for normal and re-entrant calls.
  • Transform exceptions are mapped to JSON-RPC errors without stopping the server.
  • Added transform disposal through dispose() during shutdown.
  • Skips the transform pipeline when no transforms are configured.

Tests

  • Pipeline tests: ordering, next chaining, unknown tools, error mapping, disposal order, and duplicate names.
  • Re-entrancy tests: transform skipping and scoped tool calls.
  • App-level tests: tools/list byte-for-byte parity against a pre-change baseline across legacy, auto, and modern protocol eras; transform composition; failing transforms; and shutdown behavior.
  • Targeted test results: 16 passed across test_transforms_pipeline.py, test_transforms_reentrancy.py, and test_transformsapp.py.
  • Full-suite status: one failure remains in tests/test_readme_examples.py::test_building_blocks_run. The AuditLog receives A1 twice instead of once. This appears to be a duplicate event/listener invocation and still needs investigation. Full-suite parity with main has not yet been established.

Dependency

Depends on #22.

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