get_tissue_expression
Retrieve tissue-specific protein expression data by gene symbol from the Human Protein Atlas. Supports JSON and TSV formats for data analysis and integration.
Instructions
Get tissue-specific expression data for a protein
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format (default: json) | |
| gene | Yes | Gene symbol |
Implementation Reference
- src/index.ts:893-919 (handler)The main handler function for the 'get_tissue_expression' tool. Validates input using isValidGeneArgs, fetches tissue expression data via fetchTissueExpression, and returns formatted JSON response or error.private async handleGetTissueExpression(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchTissueExpression(args.gene); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching tissue expression: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:487-494 (schema)Input schema for the tool defining required 'gene' parameter and optional 'format'.inputSchema: { type: 'object', properties: { gene: { type: 'string', description: 'Gene symbol' }, format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' }, }, required: ['gene'], },
- src/index.ts:484-495 (registration)Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'get_tissue_expression', description: 'Get tissue-specific expression data for a protein', inputSchema: { type: 'object', properties: { gene: { type: 'string', description: 'Gene symbol' }, format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' }, }, required: ['gene'], }, },
- src/index.ts:676-677 (registration)Dispatch case in the CallToolRequestSchema switch statement that routes to the handler.case 'get_tissue_expression': return this.handleGetTissueExpression(args);
- src/index.ts:748-751 (helper)Helper function that fetches tissue-specific expression data by querying the API with tissue-related columns.private async fetchTissueExpression(gene: string): Promise<any> { const columns = ['g', 'eg', 'rnats', 'rnatd', 'rnatss', 't_RNA_adipose_tissue', 't_RNA_adrenal_gland', 't_RNA_brain', 't_RNA_breast', 't_RNA_colon', 't_RNA_heart_muscle', 't_RNA_kidney', 't_RNA_liver', 't_RNA_lung', 't_RNA_ovary', 't_RNA_pancreas', 't_RNA_prostate', 't_RNA_skeletal_muscle', 't_RNA_skin_1', 't_RNA_spleen', 't_RNA_stomach_1', 't_RNA_testis', 't_RNA_thyroid_gland']; return this.searchProteins(gene, 'json', columns, 1); }
- src/index.ts:63-73 (helper)Validation function for gene-based tool arguments, used by get_tissue_expression handler.const isValidGeneArgs = ( args: any ): args is { gene: string; format?: string } => { return ( typeof args === 'object' && args !== null && typeof args.gene === 'string' && args.gene.length > 0 && (args.format === undefined || ['json', 'tsv', 'xml', 'trig'].includes(args.format)) ); };