Spaces:
Running

AhmedMSLTI commited on
Commit
b24e629
·
1 Parent(s): 1062e8c

Document MCP gate semantics

Browse files
Files changed (1) hide show
  1. mcp-server.mjs +55 -13
mcp-server.mjs CHANGED
@@ -35,19 +35,55 @@ const agentTaskInputSchema = {
35
  type: "object",
36
  additionalProperties: true,
37
  properties: {
38
- false_negative_cost: { type: "number", minimum: 0 },
39
- false_positive_cost: { type: "number", minimum: 0 },
40
- minimum_recall: { type: "number", minimum: 0, maximum: 1 },
41
- cutoff_date: { type: "string" },
42
- prediction_horizon: { type: "string" },
43
- group_split_column: { type: "string" },
44
- input_validation_acknowledged: { type: "boolean" },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  leakage_field_known_before_prediction: {
46
  type: "object",
 
 
47
  additionalProperties: { type: "boolean" }
48
  },
49
  accepted_gate_ids: {
50
  type: "array",
 
 
51
  items: { type: "string" }
52
  }
53
  }
@@ -58,12 +94,14 @@ const agentTaskInputSchema = {
58
  export const tools = [
59
  {
60
  name: "mille_generate_blueprint",
61
- description: "Generate a MILLE ML system blueprint from a plain-language project idea.",
 
62
  inputSchema: agentTaskInputSchema
63
  },
64
  {
65
  name: "mille_profile_dataset",
66
- description: "Profile CSV text and infer target, task type, feature groups, leakage warnings, and executable baselines.",
 
67
  inputSchema: {
68
  type: "object",
69
  required: ["csv_text"],
@@ -79,7 +117,8 @@ export const tools = [
79
  },
80
  {
81
  name: "mille_search_knowledge",
82
- description: "Retrieve curated ML knowledge chunks used by MILLE for source-backed blueprint reasoning.",
 
83
  inputSchema: {
84
  type: "object",
85
  additionalProperties: false,
@@ -96,7 +135,8 @@ export const tools = [
96
  },
97
  {
98
  name: "mille_validate_contract",
99
- description: "Validate a MILLE blueprint or dataset profile against the public agent contracts.",
 
100
  inputSchema: {
101
  type: "object",
102
  required: ["kind", "value"],
@@ -109,7 +149,8 @@ export const tools = [
109
  },
110
  {
111
  name: "mille_score_blueprint",
112
- description: "Score a generated blueprint for agent readiness using MILLE contract, gate, data, and knowledge checks.",
 
113
  inputSchema: {
114
  type: "object",
115
  required: ["blueprint"],
@@ -121,7 +162,8 @@ export const tools = [
121
  },
122
  {
123
  name: "mille_export_project",
124
- description: "Generate a starter project manifest, and optionally a base64 ZIP, from a MILLE blueprint request.",
 
125
  inputSchema: {
126
  type: "object",
127
  required: ["idea"],
 
35
  type: "object",
36
  additionalProperties: true,
37
  properties: {
38
+ false_negative_cost: {
39
+ type: "number",
40
+ minimum: 0,
41
+ description:
42
+ "Business cost of a false negative. Supply both cost fields together with minimum_recall to resolve the metric-validity gate when it fires on severe class imbalance."
43
+ },
44
+ false_positive_cost: {
45
+ type: "number",
46
+ minimum: 0,
47
+ description:
48
+ "Business cost of a false positive. Supply both cost fields together with minimum_recall to resolve the metric-validity gate when it fires on severe class imbalance."
49
+ },
50
+ minimum_recall: {
51
+ type: "number",
52
+ minimum: 0,
53
+ maximum: 1,
54
+ description:
55
+ "Minimum acceptable recall in (0, 1]. Supplied together with false_negative_cost and false_positive_cost to resolve metric-validity."
56
+ },
57
+ cutoff_date: {
58
+ type: "string",
59
+ description:
60
+ "ISO date (YYYY-MM-DD) separating train from test. Resolves the temporal component of split-validity. Must fall strictly inside the profiled date column's observed range, or the gate stays blocking with a range-mismatch message."
61
+ },
62
+ prediction_horizon: {
63
+ type: "string",
64
+ description:
65
+ "Free-text prediction horizon, such as '12 months'. Alternative or companion to cutoff_date for resolving split-validity's temporal component."
66
+ },
67
+ group_split_column: {
68
+ type: "string",
69
+ description:
70
+ "Name of the repeated-entity or group column to use for group-aware validation. Resolves the group component of split-validity. Should match a name in a prior response's consequences computed group_signals."
71
+ },
72
+ input_validation_acknowledged: {
73
+ type: "boolean",
74
+ description:
75
+ "Set true to acknowledge that generated input-validation code from data-contract-gate is a required implementation artifact you will actually wire in."
76
+ },
77
  leakage_field_known_before_prediction: {
78
  type: "object",
79
+ description:
80
+ "Map of column name to boolean, declaring whether each blocked leakage column is known before prediction time. Keys must match target-leakage computed blocked_columns from a prior response. false excludes the column from features; true asserts it is safe to keep.",
81
  additionalProperties: { type: "boolean" }
82
  },
83
  accepted_gate_ids: {
84
  type: "array",
85
+ description:
86
+ "List of gate ids, such as 'train-test-overlap-gate', to explicitly accept as a known unresolved risk instead of fixing them. Works for any gate, including ones with no other resolution path.",
87
  items: { type: "string" }
88
  }
89
  }
 
94
  export const tools = [
95
  {
96
  name: "mille_generate_blueprint",
97
+ description:
98
+ "Generate a MILLE ML blueprint (decision, consequence gates, and runnable train/preprocessing/schema files) from a plain-language idea, optionally grounded in a profiled dataset. Check the returned blueprint's consequences.blocking array and consequences.verdict before treating the returned files as usable: a non-empty consequences.blocking array means the generated code is not safe to run as-is and may train on leaked features, use an invalid split, or fail immediately by design. Re-call this tool with gate_answers supplying what each blocking gate's questions ask for, or accepted_gate_ids to explicitly accept a risk, until consequences.blocking is empty.",
99
  inputSchema: agentTaskInputSchema
100
  },
101
  {
102
  name: "mille_profile_dataset",
103
+ description:
104
+ "Profile CSV text to infer the target, task type, feature groups, and known-issue signals (leakage_warnings, quality_warnings, split_warnings, holdout_overlap) before generating a blueprint. Call this before mille_generate_blueprint or mille_export_project whenever real training data exists: several consequence gates, including group/entity leakage, statistical leakage, and train-test overlap, only activate when a real dataset_profile is supplied; idea text alone cannot detect them. Pass the returned profile object verbatim as dataset_profile in later calls; do not hand-construct one. Optionally supply holdout_csv_text and holdout_filename to check a separate holdout file for row-level overlap with training data.",
105
  inputSchema: {
106
  type: "object",
107
  required: ["csv_text"],
 
117
  },
118
  {
119
  name: "mille_search_knowledge",
120
+ description:
121
+ "Retrieve curated ML knowledge chunks (definitions, pitfalls, formulas) used to ground blueprint reasoning in mille_generate_blueprint. task_type filters results, and limit caps the count. Informational only: this tool returns entries and does not affect consequence gates or scoring.",
122
  inputSchema: {
123
  type: "object",
124
  additionalProperties: false,
 
135
  },
136
  {
137
  name: "mille_validate_contract",
138
+ description:
139
+ "Validate a blueprint or dataset profile object against MILLE's public agent contract schema. Set kind to \"blueprint\" or \"dataset_profile\" to match the object passed as value.",
140
  inputSchema: {
141
  type: "object",
142
  required: ["kind", "value"],
 
149
  },
150
  {
151
  name: "mille_score_blueprint",
152
+ description:
153
+ "Score a blueprint's agent-readiness (0-100; verdict ready, needs_review, or not_ready). blueprint must be the structuredContent.blueprint object returned by mille_generate_blueprint, not the full tool response envelope. A ready verdict requires zero unresolved blocking gates on the blueprint you pass in, so score after resolving gates, not before, or expect and trust a reduced score.",
154
  inputSchema: {
155
  type: "object",
156
  required: ["blueprint"],
 
162
  },
163
  {
164
  name: "mille_export_project",
165
+ description:
166
+ "Generate a starter project manifest, and optionally a base64 ZIP, from the same inputs as mille_generate_blueprint. export_allowed is false and no ZIP is produced whenever any consequence gate is still blocking; check blocking_gates in the response before using the export. dataset_csv only embeds the given CSV into the exported project's data/ folder: it is not analyzed for leakage, group structure, or train-test overlap. To get real dataset-aware gate coverage in the export, call mille_profile_dataset first, optionally with holdout_csv_text, and pass its returned profile as dataset_profile. Supplying dataset_csv alone silently skips all dataset-derived consequence checks.",
167
  inputSchema: {
168
  type: "object",
169
  required: ["idea"],