get_dataset_info
Retrieve details about GTEx genomics datasets, including available IDs and metadata, for informed data selection and analysis.
Instructions
Get information about available GTEx datasets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datasetId | No | Specific dataset ID (optional, returns all if not provided) |
Implementation Reference
- Handler function that executes the get_dataset_info tool logic. Fetches dataset info from API client and formats detailed output including sample stats, genomic references, and QTL data./** * Get dataset information */ async getDatasetInfo(args: any) { const result = await this.apiClient.getDatasetInfo(args.datasetId); if (result.error) { return { content: [{ type: "text", text: `Error retrieving dataset information: ${result.error}` }], isError: true }; } const datasets = result.data || []; if (datasets.length === 0) { return { content: [{ type: "text", text: "No dataset information available." }] }; } let output = `**GTEx Dataset Information**\n\n`; datasets.forEach((dataset, index) => { if (datasets.length > 1) { output += `### Dataset ${index + 1}: ${dataset.datasetId}\n`; } output += `**Basic Information:**\n`; output += ` • ID: ${dataset.datasetId}\n`; output += ` • Display Name: ${dataset.displayName}\n`; output += ` • Organization: ${dataset.organization}\n`; if (dataset.description) { output += ` • Description: ${dataset.description}\n`; } if (dataset.dbgapId) { output += ` • dbGaP ID: ${dataset.dbgapId}\n`; } output += `\n**Genomic References:**\n`; output += ` • Genome Build: ${dataset.genomeBuild}\n`; output += ` • GENCODE Version: ${dataset.gencodeVersion}\n`; if (dataset.dbSnpBuild) { output += ` • dbSNP Build: ${dataset.dbSnpBuild}\n`; } output += `\n**Sample Statistics:**\n`; output += ` • Total subjects: ${dataset.subjectCount.toLocaleString()}\n`; output += ` • Total tissues: ${dataset.tissueCount}\n`; output += ` • RNA-seq samples: ${dataset.rnaSeqSampleCount.toLocaleString()}\n`; output += ` • RNA-seq + genotype samples: ${dataset.rnaSeqAndGenotypeSampleCount.toLocaleString()}\n`; output += `\n**QTL Analysis:**\n`; output += ` • eQTL subjects: ${dataset.eqtlSubjectCount.toLocaleString()}\n`; output += ` • eQTL tissues: ${dataset.eqtlTissuesCount}\n`; if (datasets.length > 1 && index < datasets.length - 1) { output += '\n'; } }); return { content: [{ type: "text", text: output }] }; }
- src/index.ts:533-544 (schema)MCP tool schema definition including inputSchema for datasetId parameter.name: "get_dataset_info", description: "Get information about available GTEx datasets", inputSchema: { type: "object", properties: { datasetId: { type: "string", description: "Specific dataset ID (optional, returns all if not provided)" } } } },
- src/index.ts:763-767 (registration)Tool dispatch/registration in the CallToolRequestSchema handler that routes calls to the referenceHandlers.getDatasetInfo method.if (name === "get_dataset_info") { return await referenceHandlers.getDatasetInfo({ datasetId: args?.datasetId }); }
- src/utils/api-client.ts:133-142 (helper)API client helper method that makes HTTP request to GTEx Portal API for dataset information.async getDatasetInfo(datasetId?: string): Promise<GTExApiResponse<DatasetInfo[]>> { try { const params = datasetId ? { datasetId } : {}; const queryParams = this.buildQueryParams(params); const response = await this.axiosInstance.get(`/metadata/dataset?${queryParams}`); return { data: response.data }; } catch (error) { return error as GTExApiResponse<DatasetInfo[]>; } }