Skip to content

e2e tests: mcp: construct payloads using structs + serialize#7464

Open
plebedev wants to merge 1 commit into
tensorzero:mainfrom
plebedev:4710_mcp_struct
Open

e2e tests: mcp: construct payloads using structs + serialize#7464
plebedev wants to merge 1 commit into
tensorzero:mainfrom
plebedev:4710_mcp_struct

Conversation

@plebedev
Copy link
Copy Markdown

Contributes to #4710.

Refactor MCP e2e tests to use typed request structs for constructing tool payloads.

Refactor Payload Construction:
Replace raw JSON payloads with typed request structs and small MCP-specific wrapper structs in mcp/common.rs.
Use core request types such as CreateDatapointsRequest, GetDatapointsRequest, ListDatapointsRequest, UpdateDatapointsRequest, DeleteDatapointsRequest, ListDatasetsRequest, ListInferencesRequest, and GetInferencesRequest.
Add typed helpers for MCP-only tool params such as dataset_name, feedback lookup params, inference params, and list episode params.
Keep raw JSON only for intentionally malformed request tests and arbitrary JSON values inside typed request structs.

Affected Tests:
MCP datapoint tests in create_datapoints.rs, create_datapoints_from_inferences.rs, get_datapoints.rs, list_datapoints.rs, update_datapoints.rs, and delete_datapoints.rs.
MCP inference tests in inference.rs, list_inferences.rs, and get_inferences.rs.
MCP dataset, feedback, and episode tests in list_datasets.rs, feedback.rs, get_feedback_by_target_id.rs, get_latest_feedback_by_metric.rs, get_feedback_by_variant.rs, and list_episodes.rs.

Verification:
cargo check -p tensorzero-core --test e2e --features e2e_tests passes.

@tensorzero-cla-bot
Copy link
Copy Markdown

tensorzero-cla-bot Bot commented May 11, 2026

✅ All contributors to this pull request have signed the TensorZero CLA. Thank you!

@plebedev
Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

tensorzero-cla-bot Bot added a commit that referenced this pull request May 11, 2026
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