Skip to main content
Glama

Mne Decode

mne_decode

Decode two conditions over time with cross-validated classifiers, supporting sliding or generalizing analyses and multiple CV strategies.

Instructions

Time-resolved decoding (MVPA): train a classifier at each time point to discriminate two conditions, with cross-validation. cond_a/cond_b are event_id names (e.g. 'target','standard'). Supports stratified, stratified_group or leave_one_group_out CV. groups must align with ALL retained input epochs before condition filtering. Saves mean scores under name, per-fold scores under name_folds and split diagnostics under name_details. method='sliding' returns (time,), 'generalizing' returns (train_time, test_time). Optional tmin/tmax crop a copy in seconds. C>0, class_weight=null|'balanced' and max_iter configure fold-local logistic regression. Choose them before CV or use nested CV via mne_run_code for tuning. Reference lines are not significance. Requires scikit-learn.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
CNo
cvNo
nameNodecoding
plotNo
tmaxNo
tminNo
picksNo
cond_aNo
cond_bNo
groupsNo
methodNosliding
scoringNoroc_auc
shuffleNo
max_iterNo
cv_strategyNostratified
epochs_nameNoepochs
class_weightNo
random_stateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.4.4
    • addedInput schema / properties / C
      Added value: +{
      +  "default": 1,
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / class_weight
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "balanced",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / cv_strategy
      Added value: +{
      +  "default": "stratified",
      +  "enum": [
      +    "stratified",
      +    "stratified_group",
      +    "leave_one_group_out"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / groups
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / max_iter
      Added value: +{
      +  "default": 1000,
      +  "type": "integer"
      +}
    • addedInput schema / properties / method
      Added value: +{
      +  "default": "sliding",
      +  "enum": [
      +    "sliding",
      +    "generalizing"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / picks
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / plot
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / random_state
      Added value: +{
      +  "default": 97,
      +  "type": "integer"
      +}
    • addedInput schema / properties / shuffle
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / tmax
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / tmin
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does a lot: it discloses output side effects (saves mean/fold/detail outputs), return shapes per method, non-destructive cropping ('crop a copy'), model configuration facts, and the caveat that reference lines are not significance. It also states the scikit-learn dependency. This is rich behavioral disclosure; only minor details like plot behavior are left implicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but compact, front-loading the core purpose and placing caveats and alternatives at the end. Each clause adds information, but the lack of a clear section/format makes it a slight reading load.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter tool with 0% schema description coverage and no annotations, the description is unusually complete, covering outputs, CV behavior, return shapes, and non-destructive cropping. It still leaves a few parameters and the exact plot behavior unexplained, but the existence of an output schema reduces the need to describe return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain parameters and largely does: cond_a/cond_b, groups alignment, method output shapes, tmin/tmax, C/class_weight/max_iter, and cv_strategy are all given semantics beyond their names. Some parameters (picks, scoring, shuffle, epochs_name, random_state) are not addressed, so compensation is strong but not complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly explains the tool performs time-resolved MVPA decoding, training a classifier at each time point to discriminate two conditions with cross-validation. This is a specific verb+resource description, though it does not explicitly contrast with the sibling mne_decoding_group_test, so it stops short of full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (two-condition time-resolved decoding) and gives a concrete alternative for hyperparameter tuning ('use nested CV via mne_run_code for tuning'). It does not state when to prefer this over mne_decoding_group_test or list exclusions, so guidance is present but mostly implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.