Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
EPHYS_MCP_OUTPUT_DIRNoOverride the directory where plot tools save PNG files. Defaults to ~/.cache/ephys-mcp/plots.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_sourcesA

List the data source types this server can open, with their parameters and status.

open_sessionB

Open a recording session and return its session_id and metadata.

`params` overrides the source's default_params (see list_sources).
close_sessionC

Close a session and drop any decoder fitted on it.

get_session_infoB

Metadata for a session: duration, channels, sampling rates, behaviour signals, licence, citation.

get_signal_qualityB

Noise level, SNR and dead/noisy channels from a broadband snippet (max 10 s).

detect_spikesC

Threshold-crossing spike detection on a broadband snippet (max 10 s).

Where the session has ground-truth spikes, precision and recall are reported.

set_probe_geometryA

Tell the server where the recording's contacts are, for sessions whose file does not say.

Named layouts: 'utah' (square grid, e.g. 96 contacts at 400 um), 'grid' with n_columns,
'linear' (one column at pitch_um, e.g. a laminar probe), 'tetrode_linear' (groups of four).
'explicit' takes positions_um as [[x, y], ...] in channel order. Geometry is used by
sort_spikes and plot_probe. Contacts under 100 um apart are sorted jointly.
get_probeB

Contact geometry and brain-area labels per channel, where known. Use the channel indices with the units argument of get_psth / fit_latent_factors to analyse one area.

plot_probeB

Figure: the array map, each contact coloured by its firing rate over a window, with area labels and sorted units marked when a sort has been run. Needs geometry from the file or set_probe_geometry.

sort_spikesA

Spike-sort a broadband window (needs the sort extra). Afterwards the session's spike times are the sorted units, restricted to that window, so rates, PSTHs, rasters and decoders use them.

Uses the session's probe geometry (from the file or set_probe_geometry) so nearby contacts
are sorted jointly; without geometry each channel is treated as an independent electrode.
Sorting takes seconds to a few minutes depending on duration and channel count.
get_firing_ratesC

Population firing-rate summary over a time range (defaults to the whole session).

fit_decoderA

Fit a decoder from spike counts to a behaviour signal and score it on held-out data.

The first `train_fraction` of the session trains; the remainder tests. With no
`target`, the first velocity-like behaviour signal is used. Unrecorded gaps are skipped.
`mask` names a boolean behaviour signal (such as FALCON's eval_mask); only bins where it
is true are used for fitting and scoring.
evaluate_cross_sessionA

Fit a decoder on one session and score it, unchanged, on other sessions: the question benchmarks such as FALCON ask (does a decoder survive to a later day?).

All sessions must be open and share the same units/channels. `mask` names a boolean
behaviour signal restricting which bins are scored (FALCON files carry `eval_mask`; pass
null when the sessions have none). Also reports same-session held-out R² for comparison.
decode_windowC

Decode a window with the fitted decoder; returns a downsampled decoded-vs-true preview.

get_psthA

Peri-stimulus time histogram: firing aligned to a trial event and averaged over trials.

`event` is one of the session's event_columns (default: movement onset if present).
`group_by` splits trials by one of its group_columns, e.g. reach direction.
`units` restricts the analysis to some units; tuning that cancels in the population
average (such as direction preference) only shows up per unit. Unit numbers in the
result index into `units` when it is given.
Returns the population time course, its peak, and the units that change most.
fit_latent_factorsA

Fit low-dimensional latent factors to trial-aligned population activity.

GPFA (Yu et al. 2009) gives denoised single-trial trajectories and a timescale per factor;
PCA is the fast, noisier baseline. Look for an elbow in variance_explained_per_factor to
judge dimensionality. If the session has a velocity-like signal, reports how well the top
factors explain it. Then plot_latent_factors draws the trajectories.
plot_latent_factorsA

Figure: the top three latent factors over time (single trials thin, group means bold), the trajectory in the plane of the first two factors, and variance explained per factor. Requires fit_latent_factors first.

plot_psthB

Figure: population PSTH per group (mean ± SEM over trials) above a unit-by-time heatmap of change from baseline. Same arguments as get_psth. Returns the PNG path and the image.

plot_rasterC

Figure: spike raster for a time window (max 60 s), with unrecorded spans shaded.

plot_decodingA

Figure: decoded against actual behaviour for a window (max 60 s), one panel per dimension. Requires fit_decoder first. Pick a window in the test split for an honest picture.

list_lsl_streamsB

Lab Streaming Layer streams visible on the local network (needs the lsl extra).

get_stream_statusB

For a live session: how much signal is buffered, whether data is still arriving, and drops.

search_datasetsA

Search the DANDI Archive for datasets. An empty query returns a short curated list of intracortical datasets that work well with this server.

list_dataset_filesC

Licence, citation and NWB files of a DANDI dataset. Pass a file's path to open_session(source='dandi').

Prompts

Interactive templates invoked by user choice

NameDescription
analyze_sessionWalk through a standard first-pass analysis of a session.
falcon_evaluateRun a FALCON-style cross-session evaluation on a FALCON dataset from DANDI.

Resources

Contextual data attached and managed by the client

NameDescription
sessions_resourceCurrently open sessions.

TDQS

B3.3/5.0

Scored across 24 tools

Disambiguation4/5

Most tools have clearly distinct purposes, and the descriptions separate similar operations well. Minor overlap exists between open_session/get_session_info (both return metadata) and detect_spikes/sort_spikes (both derive spike times from broadband data), but the descriptions clarify the different workflows.

Naming Consistency5/5

Tool names follow a consistent snake_case verb_noun pattern: open_session, close_session, get_session_info, set_probe_geometry, list_sources, fit_decoder, sort_spikes, plot_raster. The naming convention is uniform and predictable across all 24 tools.

Tool Count3/5

At 24 tools, the server is on the heavy end of the borderline range and covers a broad electrophysiology workflow. While each tool seems to have a legitimate role, the sheer number may make tool selection more difficult than necessary.

Completeness4/5

The tool set covers the main ephys lifecycle: dataset discovery, session open/close, metadata, signal quality, spike detection/sorting, decoding, latent factor analysis, and plotting. Minor gaps exist, such as no explicit list of currently open sessions or raw signal extraction, but these are workable around and do not block the core workflow.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive