Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

feat(experiments): add missing experimentation tools.#123

Merged
rodrigoi merged 39 commits intomainfrom
experiments/results-and-create-experiment-tools
Sep 18, 2025
Merged

feat(experiments): add missing experimentation tools.#123
rodrigoi merged 39 commits intomainfrom
experiments/results-and-create-experiment-tools

Conversation

@rodrigoi
Copy link
Contributor

@rodrigoi rodrigoi commented Sep 8, 2025

Problem

The MCP tool is missing some key tooling for retrieve experiment exposures, results and to create and update experiments.

Changes

We've added new tools to the MCP server to complete the loop of experiment manipulation tools:

experiment-exposure-query

This tool enables LLMs to access the complete exposure time series using the experimentId.

Very Naive Exposure Chart
Screenshot 2025-09-08 at 00 30 10

experiment-metric-results-get

This tool enables LLMs to get the complete set of metric results to provide analysis and interpretation of those results.

Experiment Result Analysis
Screenshot 2025-09-08 at 00 50 01
Naive Credible Interval
Screenshot 2025-09-08 at 01 01 56

experiment-create

This tool allows LLMs to create experiments after querying the user for a hypothesis, feature flags and events.

Claude created a new experiment Experiment Ready for Launch
image image

How did you test this code?

cat-type-small

@rodrigoi rodrigoi requested review from a team September 8, 2025 05:47
@rodrigoi rodrigoi self-assigned this Sep 8, 2025
@rodrigoi rodrigoi marked this pull request as ready for review September 8, 2025 07:04
@rodrigoi rodrigoi force-pushed the experiments/results-and-create-experiment-tools branch from 18a74ac to 80ab599 Compare September 8, 2025 07:15
Copy link
Collaborator

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Looks great 🙌

Left some small comments to address and then think we're good to merge it in. Do we want to do experiment-update / experiment-delete tools in a different PR?

Copy link
Collaborator

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Oh and we'll need to add integration tests for the changes to the API client and for the new tools :)

@joshsny joshsny self-requested a review September 8, 2025 19:56
@rodrigoi
Copy link
Contributor Author

rodrigoi commented Sep 8, 2025

@joshsny ! Thanks for the review! I'll get your feedback in and let you know when it's ready for another review!

This PR got a bit large, so experiment-update / experiment-delete will come after. I would like to clean up the schemas a bit too.

@joshsny
Copy link
Collaborator

joshsny commented Sep 12, 2025

@rodrigoi FYI there are some issues currently with integration tests, so if those are failing you can ignore that for now, they are having intermittent failure issues

@rodrigoi rodrigoi force-pushed the experiments/results-and-create-experiment-tools branch from 9cc87df to 8d390da Compare September 14, 2025 23:40
@rodrigoi
Copy link
Contributor Author

@joshsny This is ready for another review. I caved and added the experiment-delete and experiment-update tools. An agent generated tests, and I'll take another look at the experiment schemas in the future because there's some duplication I'd like to remove. Otherwise, I tested with Claude and the MCP Inspector.

Copy link
Collaborator

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Super nice, can't wait to get this merged, left some small comments before merging :)

@joshsny
Copy link
Collaborator

joshsny commented Sep 15, 2025

@rodrigoi tested this locally and it works well for me!

@joshsny
Copy link
Collaborator

joshsny commented Sep 15, 2025

@rodrigoi pushed a .nullish() on one of the schemas to get it working for me on team 2 :)

rodrigoi and others added 23 commits September 18, 2025 01:08
…od schemas, transformations and derived types.
@rodrigoi rodrigoi force-pushed the experiments/results-and-create-experiment-tools branch from 5213279 to ba9076f Compare September 18, 2025 04:13
@rodrigoi
Copy link
Contributor Author

@joshsny I did a whole refactor pass over the schema to make more... idiomatic Zod, and removed some of the duplication. Updated integration tests (we need to update the scope of the token we are using today), rebased, and tested extensively, but I would like your final approval before merging 😉

Copy link
Collaborator

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Looks great! Let's ship it 🚢 🙌

@joshsny
Copy link
Collaborator

joshsny commented Sep 18, 2025

Updated the API key and the integration tests are passing now, so we should be good to go 🚢

@rodrigoi rodrigoi merged commit a5ce513 into main Sep 18, 2025
11 of 12 checks passed
@rodrigoi rodrigoi deleted the experiments/results-and-create-experiment-tools branch September 18, 2025 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants