Skip to main content
Glama

sort_spikes

Spike-sort a broadband window, making sorted units available for rates, PSTHs, rasters, and decoders. Uses probe geometry to sort nearby contacts jointly for accurate results.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
t0No
sorterNospykingcircus2
channelsNo
duration_sNo
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A3.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses a meaningful side effect (spike times become the sorted units restricted to the window), explains how probe geometry changes sorting behavior, and gives a runtime expectation. It stops short of stating whether existing spike/unit data is overwritten or describing error/failure modes.

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

Conciseness5/5

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

The description is compact and front-loaded: the main operation and prerequisite come first, followed by the side effect, geometry behavior, and performance expectation. Every sentence adds useful information and there is no filler.

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

Completeness3/5

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

For a five-parameter tool with no annotations and no output schema, the description covers the core operation, side effects, and dependencies well. However, it leaves several parameter semantics (t0, sorter, channels) to be inferred from schema titles/defaults, and it does not describe what the tool returns or how success is communicated.

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

Parameters2/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 compensate, but it only loosely references 'duration and channel count' and 'window.' It does not explain t0, sorter choices, channels, or session_id semantics beyond what the schema titles/defaults/enum already show. This is only partial compensation for a low-coverage schema.

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?

The description uses a specific verb ('Spike-sort') and resource ('broadband window'), and clearly states the outcome: session spike times become sorted units restricted to that window. It does not explicitly distinguish itself from siblings like detect_spikes, though the sort-vs-detect distinction is largely implicit.

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

Usage Guidelines4/5

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

The description gives clear usage context: it requires the sort extra, relies on probe geometry (optionally set via set_probe_geometry), and produces sorted units that downstream analyses like PSTHs, rasters, and decoders will use. It does not name explicit alternatives or when-not-to-use conditions, but the prerequisites and downstream role are clearly stated.

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