aind-data-mcp

v0.4.21
aind-data-mcp Checked 17 hours ago Published 2 months ago

Generated from aind-library-template

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

identify_nwb_contents_in_code_ocean Identify Nwb Contents In Code Ocean

Searches the /data directory in a code ocean repository for a folder and subfolder containing the subject_id and date, and loads the corresponding NWB file. Parameters: - subject_id (str): Subject identifier to search for in directory names - date (str): Date string (e.g. '2023-05-09') to search for in directory names Returns: - nwbfile: Loaded NWBFile object if found, else None

ParameterTypeDescription
date *
subject_id *

get_records Get Records

Retrieve metadata documents with a simple MongoDB filter and projection. Use this for straightforward dataset and asset lookups. Common V2 leaf paths are ``subject.subject_id``, ``subject.subject_details.sex`` (legacy alias ``subject.sex``), ``subject.subject_details.date_of_birth``, ``subject.subject_details.strain.name``, ``subject.subject_details.genotype``, ``subject.subject_details.breeding_info.maternal_genotype``, ``subject.subject_details.breeding_info.paternal_genotype``, ``data_description.project_name``, ``data_description.data_level``, ``data_description.modalities.abbreviation``,…

ParameterTypeDescription
filterMongoDB query filter. For example, ``{"subject.subject_details.sex": "Male"}``. An empty filter returns all documents.
include_metadatabooleanIf true, return ``{"records": [...], "metadata": {...}}`` with a reproducible marker for the exact result set and the AIND API version.
limitintegerMaximum number of records to retrieve. Keep this at or below 100 when possible.
projectionFields to include or exclude. Use 1 to include a field and 0 to exclude it. An empty projection returns all fields.

aggregation_retrieval Aggregation Retrieval

Run a MongoDB aggregation pipeline for transformed metadata queries. Use ``get_schema_context(detail='paths')`` for compact V2 field paths. Common grouping fields are ``data_description.project_name``, ``data_description.data_level``, ``data_description.modalities.abbreviation``, and ``subject.subject_details.sex``. Parent projections such as ``{"acquisition": 1}`` return the entire nested object, so project only required leaf paths. Direct recipes: - Project counts: ``[{"$group": {"_id": "$data_description.project_name", "count": {"$sum": 1}}}, {"$sort": {"count": -1…

ParameterTypeDescription
agg_pipeline *arrayMongoDB aggregation stages such as ``$match``, ``$project``, ``$group``, ``$sort``, and ``$unwind``.
field_aliasesMap a logical field name to ordered MongoDB paths. The tool creates ``_aind_aliases`` using the first non-null value. For legacy sex data, use ``{"subject_sex": ["subject.subject_details.sex", "subjec…
include_metadatabooleanIf true, return ``{"records": [...], "metadata": {...}}`` with a reproducible result marker, API version, and retrieval time. The upstream API exposes no global database revision.

count_records Count Records

Retrieves number of documents from MongoDB database using a simple MongoDB filter WHEN TO USE THIS FUNCTION: - For counting number of documents based on a straightforward criteria NOT RECOMMENDED FOR: - Complex data transformations (use aggregation_retrieval instead)

ParameterTypeDescription
filterMongoDB query filter to narrow down the documents to retrieve. Example: {"subject.subject_details.sex": "Male"} If empty dict object, returns all documents.

get_summary Get Summary

Get an LLM-generated summary for a data asset, based on the _id field

ParameterTypeDescription
_id *string

flatten_records Flatten Records

Flatten a list of records into dot-notation.

ParameterTypeDescription
records *arrayList of dicts.
depthHow deep to flatten.

get_project_names Get Project Names

Exposes project names in database

get_schema_context Get Schema Context

Reveal the complete schema or opt into compact query-oriented views. The default tree is complete and shallow. Use a dot-separated ``path`` such as ``Acquisition.data_streams`` and increase ``max_depth`` to expand one branch. Use ``detail='paths'`` for compact query paths or ``detail='example'`` for a small synthetic example.

ParameterTypeDescription
detailstring
max_depthinteger
nodestring
path

get_modality_types Get Modality Types

List modality names and abbreviations used in data asset metadata.

get_asset_basics Get Asset Basics

Query the biodata_cache asset_basics cached table. Returns one row per data asset with lightweight metadata. Covers every asset in the database and is updated incrementally, so it is always nearly current. WHEN TO USE THIS TOOL FIRST: - Discovering assets for a subject, project, modality, data level, or date - Counting or listing assets before deciding whether to fetch full records - Getting asset names / _ids for use in downstream MongoDB queries NOT A REPLACEMENT FOR get_records / aggregation_retrieval when: - Richer nested fields are required (e.g. full subject, procedures, etc.) - The q…

ParameterTypeDescription
acquisition_start_afterISO timestamp; keep assets acquired at or after this time.
acquisition_start_beforeISO timestamp; keep assets acquired before this time.
columnsColumns to return. Defaults to a compact projection containing the common discovery fields and normalized experimenter/investigator names.
data_levelFilter by data level, e.g. "raw" or "derived".
include_totalbooleanIf true, return records plus total_matches, offset, limit, and has_more metadata. The default returns the records list directly.
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
modalityFilter to assets whose modalities list contains this substring, e.g. "ecephys", "behavior", "ophys". Case-insensitive.
name_containsFilter to assets whose name contains this substring. Case-insensitive.
offsetintegerNumber of matching rows to skip for paging (default 0).
project_nameFilter to assets with this project name (exact match).
subject_idFilter to assets belonging to this subject ID (exact match).

get_unique_project_names Get Unique Project Names

Return all unique project names across the data asset database. Use this tool to: - Discover what projects exist before filtering with get_asset_basics - Validate the exact spelling of a project name

get_unique_subject_ids Get Unique Subject Ids

Return all unique subject IDs across the data asset database. Use this tool to: - Check whether a subject ID exists before deeper queries - Enumerate all subjects for a bulk analysis

get_source_data_table Get Source Data Table

Query the biodata_cache source_data cached table. Returns one row per derived asset per source data entry, mapping each derived asset back to the raw asset it was generated from, along with the pipeline name and processing timestamp. Columns: name, source_data, pipeline_name, processing_time

ParameterTypeDescription
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
pipeline_nameFilter to rows from a specific pipeline (substring match, case-insensitive).
source_asset_nameFilter to rows where the source_data column matches this raw asset name exactly (the raw asset that was processed).

get_raw_to_derived Get Raw To Derived

Return the derived asset names produced from a given raw asset. Use this tool to trace which processed/derived assets were generated from a specific raw data asset.

ParameterTypeDescription
asset_name *stringThe raw asset name to look up (e.g. "ecephys_716870_2024-07-09_15-39-28").
latestbooleanIf True, for each unique pipeline_name return only the most recent derived asset by processing_time. Useful when a raw asset has been re-processed multiple times and you only want the latest result. D…

get_qc_metrics Get Qc Metrics

Fetch quality control metrics for all assets belonging to a subject. Returns one row per QC metric per asset. Metrics are cached per subject_id; a cache miss (no prior data for this subject) will return an empty list — in that case the data may simply not yet be cached. Columns: name, stage, modality, value, status, asset_name

ParameterTypeDescription
subject_id *stringThe subject ID to fetch QC data for (maps to subject.subject_id in the full metadata document).
asset_namesOptional list of asset names to restrict results to. If omitted, returns QC metrics for all assets of the subject.

get_assets_smartspim Get Assets Smartspim

Query the biodata_cache SmartSPIM assets cached table. Returns one row per (asset, channel) with processing status and Neuroglancer visualisation links. Join with get_asset_basics on the raw_name column to get subject_id, genotype, or other metadata. Columns: name, raw_name, processed, subject_id, genotype, processing_end_time, stitched_link, raw_link, channel, segmentation_link, quantification_link

ParameterTypeDescription
channelFilter to a specific channel (substring match, case-insensitive).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
processedIf True, return only assets with a stitched derived asset. If False, return only unprocessed assets.
raw_name_containsFilter rows whose raw_name contains this substring (case-insensitive). Useful for filtering by subject ID embedded in the asset name.
subject_idFilter to assets belonging to this subject ID.

get_unique_genotypes Get Unique Genotypes

Return all unique genotypes across the data asset database. Use this tool to: - Discover what genotypes exist before filtering with get_asset_basics - Validate the exact spelling of a genotype string

get_platform_qc Get Platform Qc

Query the biodata_cache platform_qc table for tag-level QC statuses. Returns one row per (asset, tag) combination for the given platform. Cached per platform; use for quick QC status summaries without needing to pull per-metric quality_control data. Columns: asset_name, tag, status, timestamp, instrument_id_normalized, experimenters_normalized

ParameterTypeDescription
platform *stringRequired. One of: 'spim', 'fib', 'vr', 'dynamic_foraging'.
asset_nameFilter to a specific asset name (exact match).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
statusFilter by QC status, e.g. 'pass', 'fail', 'pending'.
tagFilter to rows whose tag contains this substring (case-insensitive).

get_assets_exaspim Get Assets Exaspim

Query the biodata_cache ExaSPIM assets cached table. Returns one row per ExaSPIM asset with processing status and Neuroglancer visualisation links. Columns: name, raw_name, processed, raw_link, fused_link

ParameterTypeDescription
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
processedIf True, return only assets with a fused derived asset. If False, return only unprocessed assets.
raw_name_containsFilter rows whose raw_name contains this substring (case-insensitive).

get_assets_fib Get Assets Fib

Query the biodata_cache fiber photometry (fib) assets table. Returns one row per (asset, fiber, channel) combination. Columns: asset_name, fiber, patch_cord, channel, intended_measurement, targeted_structure

ParameterTypeDescription
asset_nameFilter to a specific asset name (exact match).
channelFilter to a specific channel (substring match, case-insensitive).
fiberFilter to a specific fiber (substring match, case-insensitive).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
targeted_structureFilter by targeted brain structure (substring match, case-insensitive).

get_foraging_sessions Get Foraging Sessions

Query the biodata_cache dynamic foraging session table. Returns one row per dynamic foraging session with key performance metrics. Backed by platform_dynamic_foraging_sessions (~160 columns). Key columns: _session_id, subject_id, session_date, nwb_suffix, task, total_trials, finished_trials, finished_rate, foraging_eff, foraging_performance, bias_naive, curriculum_name, curriculum_version, current_stage_actual, foraging_eff_random_seed, reaction_time_median, early_lick_rate, hardware, rig_type, data_source, institute

ParameterTypeDescription
curriculum_nameFilter to sessions with this curriculum (substring match, case-insensitive).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
subject_idFilter to a specific subject ID (exact match).
taskFilter to sessions with this task (substring match, case-insensitive).

get_behavior_curriculum Get Behavior Curriculum

Query the biodata_cache behavior_curriculum table. Returns one row per behavior asset with its curriculum name and training stage. Columns: asset_name, curriculum_name, stage_name, stage_node_id

ParameterTypeDescription
asset_nameFilter to a specific asset name (exact match).
curriculum_nameFilter by curriculum name (substring match, case-insensitive).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
stage_nameFilter by stage name (substring match, case-insensitive).

get_time_to_qc Get Time To Qc

Query the biodata_cache time_to_qc table. Returns one row per derived asset with timestamps for processing completion and QC completion. Useful for monitoring QC throughput and identifying bottlenecks. Columns: name, process_end_time, qc_time

ParameterTypeDescription
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
name_containsFilter to assets whose name contains this substring (case-insensitive).

get_metadata_upgrade Get Metadata Upgrade

Query the biodata_cache metadata_upgrade table. Returns one row per asset showing its metadata upgrade status across schema versions. Useful for tracking which assets have been migrated to newer metadata schemas. Columns: _id, name, project_name, data_level, v2_id, upgrader_version, last_modified, status, upgrade_datetime

ParameterTypeDescription
data_levelFilter by data level, e.g. 'raw' or 'derived'.
limitintegerMaximum number of rows to return (default 100, hard maximum 100).
project_nameFilter to a specific project name (exact match).
statusFilter by upgrade status, e.g. 'success', 'failed', 'pending'.

get_foraging_trials Get Foraging Trials

Fetch dynamic foraging trial-level data for a single subject. Returns one row per trial from the hive-partitioned trial table in the upstream aind-dynamic-foraging-database. Requires a subject_id; data is cached per subject and fetched from upstream on a cache miss. Key columns: _session_id, subject_id, session_date, trial_index, animal_response, rewarded_historyL, rewarded_historyR, reward_outcome_color, go_cue_time, reaction_time, ...

ParameterTypeDescription
subject_id *stringThe subject ID to fetch trial data for (required).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).

get_foraging_events Get Foraging Events

Fetch dynamic foraging event-level data for a single subject. Returns one row per behavioral event from the hive-partitioned event table in the upstream aind-dynamic-foraging-database. Requires a subject_id; data is cached per subject and fetched from upstream on a cache miss. Key columns: _session_id, subject_id, session_date, event_type, event_time, value, ...

ParameterTypeDescription
subject_id *stringThe subject ID to fetch event data for (required).
limitintegerMaximum number of rows to return (default 100, hard maximum 100).