MCP ML Agent
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP ML Agentpredict both models for this patient and tell me if they agree"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP ML Agent — Custom Tool Assignment
Project Overview
This project demonstrates how to build and call a custom Model Context Protocol (MCP) tool using Python.
The MCP server provides machine learning tools for training, predicting, evaluating, and auditing Logistic Regression and K-Nearest Neighbors (KNN) models.
For this assignment, I implemented a custom tool called predict_both, which compares predictions from both models for the same patient.
Related MCP server: FHIR Tools MCP Server
Technologies Used
Python
Model Context Protocol (MCP)
Logistic Regression
K-Nearest Neighbors (KNN)
Scikit-learn
Parquet
uv package manager
Custom MCP Tool: predict_both
The predict_both tool:
Accepts a patient's input features.
Generates predictions using Logistic Regression and KNN.
Returns both predictions.
Indicates whether the models agree.
Records the tool execution for auditing.
How to Run
Clone the repository:
git clone https://github.com/Bharath-5577/mcp-ml-agent-assignment.git
cd mcp-ml-agent-assignmentInstall dependencies:
uv syncRun the custom client:
uv run python my_client.pyExperiment Results
The custom client evaluated 114 test patients.
Metric | Result |
Total test patients | 114 |
Model disagreements | 8 |
Logistic Regression correct on disagreements | 7 |
KNN correct on disagreements | 1 |
Better model on disagreement cases | Logistic Regression |
The disagreement patient indices were:
[3, 25, 48, 53, 76, 80, 99, 102]
These results show that Logistic Regression performed better on the eight disagreement cases. This does not necessarily establish that it performs better across every evaluation metric.
Project Files
mcp_ml_server.py— MCP server and custom toolmy_client.py— Client that calls the MCP toolsanswers.md— Written assignment responsesscreenshots/— Execution evidenceuv.lock— Dependency lockfile
Conclusion
This assignment helped me understand how to extend an existing MCP server, expose a custom tool, call it from an MCP client, compare machine learning predictions, and maintain an audit trail.
The experiment demonstrated how a custom MCP tool can simplify model comparison and make machine learning workflows easier to inspect.
Available Tools
9 toolsconfusion_matrix_metricsA
Compute the confusion matrix plus accuracy/precision/recall for both models on the test set. Precision and recall are for the malignant class. Confusion matrix order is [malignant, benign]; rows = actual, columns = predicted.
| Name | Required | Description | Default |
|---|---|---|---|
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| random_state | No | Random seed for the train/test split. | |
| knn_neighbors | No | Number of neighbors for the KNN model. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden, and it does disclose two genuinely important traits: that precision/recall refer to the malignant class, and that the matrix is ordered [malignant, benign] with rows=actual, columns=predicted. However, it never says whether calling it re-trains/re-splits the models (the knn_neighbors and test_size params suggest it might), whether it is deterministic, or what the safety profile of the operation is.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences with the core action front-loaded, and each remaining sentence adds non-obvious output semantics rather than filler. Slightly dense but no wasted text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return shape needn't be explained, and the description complements it with class orientation and matrix layout. The main gap is the relationship to prior training state and how this differs operationally from the prediction tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all four parameters (test_size, random_state, knn_neighbors, request_id) are already documented in the schema, and the description adds no per-parameter meaning. Baseline of 3 applies when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('compute the confusion matrix plus accuracy/precision/recall') and scopes it precisely ('for both models on the test set'). This cleanly separates it from siblings like predict_logistic_regression, predict_knn, and select_best_model, which perform prediction or selection rather than evaluation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'on the test set' and 'for both models' implies this is a post-training evaluation step, so usage is inferable but never stated. There is no explicit when-to-use, no ordering relative to train_models or select_best_model, and no statement of when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_parquet_auditB
Export a copy of the Parquet audit log for submission.
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Plain file name for the copy, written to data_parquet/. | audit_export.parquet |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does not say whether an existing file at the target path is overwritten, whether permissions or prior setup are needed, what the side effects are (the schema alone notes the request_id is recorded in the audit log), or whether the source log is affected beyond the word 'copy'. That is a large gap for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler; the verb and object come first. It is arguably too terse for the behavioral gaps it leaves, but there is no wasted text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need no explanation, and the schema covers both optional parameters with defaults. However, with no annotations and no mention of overwrite behavior, destination, or side effects, the description is only minimally sufficient for an agent to invoke it confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%: the schema already documents 'filename' (written to data_parquet/) and 'request_id' (recorded in the audit log) including defaults. The description adds nothing about either parameter, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Export a copy of the Parquet audit log', with the added purpose 'for submission'. It is unambiguous what the tool produces, though it offers no differentiation from siblings (none of which are audit/export tools, so that is a minor gap).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'for submission' implies the usage context (producing a deliverable artifact) but there is no explicit when-to-use, when-not-to-use, or named alternative. Usage is only implied, not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_sample_inputA
Return one test-set patient as a ready-to-use input_data dictionary for
the predict tools, along with that patient's true diagnosis.
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | Row of the held-out test set to return. | |
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| random_state | No | Random seed for the train/test split. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does disclose the two things returned (an input_data dict and the true diagnosis), but says nothing about determinism of the split, bounds/error behavior for index, or the audit-logging behavior implied by request_id. Adequate but thin for an unannotated tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler; the key output ('ready-to-use input_data dictionary') leads and the secondary return ('true diagnosis') follows. Nothing is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value explanation is not required, and the schema fully documents parameters. The description is complete enough for a simple fetch tool, with only a minor gap around how index/test_size/random_state jointly determine the returned row.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all four parameters are already documented in the schema, setting the baseline at 3. The description adds no syntax, format, or interaction details beyond the schema, so it neither compensates nor detracts.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (return) and resource (one test-set patient as an input_data dictionary plus the true diagnosis), and names its audience explicitly ('for the predict tools'), which cleanly separates it from the predict_* siblings that consume that dictionary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by tying the output to 'the predict tools', so an agent can infer this is a setup/example-fetching step before prediction. However, it gives no explicit when-to-use statement, no guidance on choosing index/test_size/random_state consistently with the split, and no exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
predict_bothA
Predict with BOTH models in one call and report whether they agree.
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | Feature dictionary with all 30 breast cancer features as numbers, keyed by their exact names (e.g. 'mean radius', 'worst area'). Use get_sample_input to get a valid example. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does disclose the key behavioral trait: both models are executed and their agreement is reported, so the agent knows to expect a comparison rather than a single prediction. It says nothing about failure modes (e.g., what happens when the models disagree), cost of running two models, or whether the call is side-effect free, beyond the audit-log hint in the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler; the differentiator (both models) and the output behavior (agreement) come first. Nothing could be removed without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema covers the return shape and the input schema fully documents parameters, so the remaining gap is small but real: the description never names which two models are used, which matters for interpreting an agreement result. For a two-parameter inference tool this is adequate but thin.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and input_data's schema text already explains the 30-feature dictionary and points to get_sample_input, so the description adds nothing about parameters. Baseline 3 is appropriate since the schema does all the work.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (predict) and resource (both models) and adds the distinguishing output behavior (agreement report). It implicitly contrasts with the single-model siblings predict_logistic_regression and predict_knn, though 'BOTH' is never resolved to actual model names in the description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: the phrase 'in one call' hints you should pick this over making two separate single-model calls, but there is no explicit when-to-use/when-not guidance and no mention of the sibling alternatives by name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
predict_knnA
Predict malignant (0) or benign (1) using the saved KNN model.
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | Feature dictionary with all 30 breast cancer features as numbers, keyed by their exact names (e.g. 'mean radius', 'worst area'). Use get_sample_input to get a valid example. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It usefully discloses the class-label mapping (0=malignant, 1=benign), which is real behavioral value, but says nothing about the prerequisite trained-model state, failure behavior when no model is saved, or whether the call is a pure read.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with zero waste. The action, model, and output interpretation are all in the first clause.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need no explanation, and the schema points to get_sample_input for valid feature examples. However, for a no-annotation inference tool the description omits the key precondition (a previously trained/saved KNN model) and any failure mode, leaving a real gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and both parameters are fully documented in the schema (input_data keyed by exact feature names, request_id for the audit log). The description adds no further parameter meaning, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb (predict), specific resource (the saved KNN model), and even the output label semantics (0=malignant, 1=benign). The model name implicitly separates it from the predict_logistic_regression sibling, though the description never explicitly contrasts them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit when-to-use/when-not statement or routing between the sibling predictors. The phrase 'the saved KNN model' only implies the prerequisite that train_models must have already run, leaving usage to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
predict_logistic_regressionB
Predict malignant (0) or benign (1) using the saved Logistic Regression model.
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | Feature dictionary with all 30 breast cancer features as numbers, keyed by their exact names (e.g. 'mean radius', 'worst area'). Use get_sample_input to get a valid example. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden, yet it discloses almost nothing beyond the purpose line. It does not state what happens if no saved model exists, whether the call is read-only or has side effects (an audit-logged call per the request_id param), or how failures surface. The word 'saved' is the only hint at a dependency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler. The output label mapping (0/1) is packed in without wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value explanation is unnecessary, and the input schema fully documents the nested feature dictionary. The only real omission is the untrained/unsaved-model prerequisite and any indication of error behavior, which the description leaves unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%: input_data is documented as a 30-feature dictionary keyed by exact feature names and even points to get_sample_input, and request_id is documented as an audit-log id. The description adds no parameter detail, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (predict), the exact output semantics (malignant=0 / benign=1), and the specific model artifact used (the saved Logistic Regression model). This distinguishes it cleanly from the sibling predict_knn without needing to open either schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to choose this over predict_knn, nor on prerequisites such as whether a Logistic Regression model must already have been trained via train_models. The only implicit usage cue is that it operates on a 'saved' model.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
select_best_modelB
Select the best model using a rule (default: recall, then precision, then accuracy).
| Name | Required | Description | Default |
|---|---|---|---|
| rule | No | One of: recall_then_precision_then_accuracy, accuracy, precision, recall. Precision/recall refer to the malignant class. | recall_then_precision_then_accuracy |
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| random_state | No | Random seed for the train/test split. | |
| knn_neighbors | No | Number of neighbors for the KNN model. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses the default rule order but says nothing about whether this mutates/persists a 'selected model' state, what preconditions exist (trained models), or any side effects. For a selection tool with zero annotation coverage this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single tight sentence that front-loads the action and includes the default. No filler, though it is perhaps too terse to be fully useful given the missing behavioral and usage detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained. However, for a tool operating on models produced by siblings, the description omits prerequisites and whether the selection persists, leaving key context incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all five parameters (rule, test_size, request_id, random_state, knn_neighbors) are already documented in the schema. The description only restates the default rule, adding nothing beyond what the schema provides. Baseline 3 applies when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource: it selects the best model using a scoring rule. An agent can tell this apart from prediction and training siblings (predict_knn, train_models), though the description doesn't explicitly name what pool of models it selects from. Clear but without mindful sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied — after training/comparing models you pick the best one by a rule. There is no statement of prerequisites (e.g., models must already be trained), no when-not-to-use, and no routing to siblings like confusion_matrix_metrics for inspecting metrics. Adequate but with clear gaps.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shap_explain_selectedB
Run SHAP for the selected model: global top features plus a local explanation for one test row. Positive SHAP values push toward malignant.
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | How many top features to return. | |
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| local_index | No | Test-set row to explain individually. | |
| random_state | No | Random seed for the train/test split. | |
| knn_neighbors | No | Number of neighbors for the KNN model. | |
| selection_rule | No | Rule used to pick the model to explain. | recall_then_precision_then_accuracy |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It does add genuine value by disclosing the sign convention ('Positive SHAP values push toward malignant'), but it fails to disclose that the tool appears to re-split data and re-train models internally (test_size, random_state, knn_neighbors, selection_rule), nor whether it is read-only, deterministic, or expensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences with no filler, and the core operation is front-loaded before the interpretive detail. Slightly under-specified rather than padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained. However, for a 7-parameter tool that re-runs training/splitting and writes to an audit log, the description omits prerequisites, cost, and how selection_rule interacts with sibling tools like select_best_model.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description loosely maps 'top features' to top_k and 'one test row' to local_index, but adds no format or semantic detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb+resource: it runs SHAP on the model chosen by the selection rule and returns both a global feature ranking and a single-row local explanation. This distinguishes it from train_models and select_best_model, though it never explicitly names those siblings as prerequisites.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied by the phrase 'for the selected model' and the selection_rule parameter, which hints that a model must be selected first. There is no explicit when-to-use statement, no when-not-to-use, and no named alternative tool for interpretation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
train_modelsB
Train Logistic Regression and KNN on the breast cancer dataset and export joblib artifacts.
| Name | Required | Description | Default |
|---|---|---|---|
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| random_state | No | Random seed for the train/test split. | |
| knn_neighbors | No | Number of neighbors for the KNN model. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does disclose one useful trait — that the call exports joblib artifacts, implying a filesystem write — but says nothing about whether existing artifacts are overwritten, where they are written, expected runtime, or any permissions/auth needed for a mutation-style tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler: verb, models, dataset, and output all appear before any padding. Nothing in the sentence is redundant with the schema or title.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present and full parameter documentation, the return values and arguments are covered. What remains missing for a training/export tool is behavioral context: overwrite semantics for the artifacts, ordering relative to the predict/select siblings, and any side-effect warnings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the schema documents all four parameters (test_size, random_state, knn_neighbors, request_id) with defaults and bounds. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb (Train), two concrete model types (Logistic Regression and KNN), the exact dataset (breast cancer), and the side effect (export joblib artifacts). This is unambiguous and clearly separable from the sibling prediction tools (predict_logistic_regression, predict_knn) and from select_best_model.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no statement of when to call this versus its siblings, e.g. whether it must be run before predict_logistic_regression/predict_knn, whether it can be re-run, or how it relates to select_best_model. The usage context is only implied by the verb 'Train'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.2.0- First observed
confusion_matrix_metrics - First observed
export_parquet_audit - First observed
get_sample_input - First observed
predict_both - First observed
predict_knn - First observed
predict_logistic_regression - First observed
select_best_model - First observed
shap_explain_selected - First observed
train_models
TDQS
Scored across 9 tools
Each tool maps to a distinct pipeline stage (training, sampling, per-model prediction, metrics, selection, explanation, export). The only mild overlap is predict_both versus the two single-model predict tools, but the descriptions make the convenience-versus-specific distinction clear.
Most names follow a verb_noun pattern (train_models, get_sample_input, predict_knn, select_best_model, export_parquet_audit). Two deviate: confusion_matrix_metrics is a bare noun phrase and shap_explain_selected is an awkward ordering, but the set remains readable and predictable.
Nine tools neatly cover one end-to-end classification workflow with no padding. Each tool earns its place: train, sample, predict, evaluate, select, explain, export.
The full lifecycle is covered: training, sample input, prediction for both models, agreement check, metrics, model selection, SHAP explanation, and audit export. Minor gaps exist (no explicit way to inspect/list saved models or retrain a single model), but agents can work around them.
Maintenance
Related MCP Connectors
Train AutoML models on CSV files and run predictions from Claude and other MCP clients.
1Privacy-preserving synthetic health data generation. FHIR R4/R5 compliant.
Diagnoses, drugs & lab codes: ICD-11, LOINC, RxNorm, MeSH, ATC, CID-10. 33 tools, MIT.
Train, explain, optimise and deploy transparent glass-box ML models via workflow tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables interaction with synthetic NIH-style clinical research data through tools for searching publications, querying patient metadata, analyzing AAA measurements, and retrieving protocol guidance.5-
- FlicenseNot gradedqualityDmaintenanceProvides FHIR resource validation, synthetic test fixture generation, and HIPAA-safe logging review as MCP tools for AI agents.-
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to query de-identified FHIR-shaped hospital data through audited, read-only tools for patients, encounters, conditions, observations, medications, and interaction checks, while any medication write stays a draft that a clinician must confirm out-of-band.MIT
- AlicenseAqualityCmaintenanceEnables training, predicting, evaluating, and explaining Logistic Regression and KNN models for breast cancer classification through MCP tools. It also supports model selection, SHAP explanations, and Parquet audit exports.8GPL 3.0