get_blood_expression
Retrieve blood cell expression data for proteins to analyze gene activity in immune cells and blood components.
Instructions
Get blood cell expression data for a protein
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gene | Yes | Gene symbol | |
| format | No | Output format (default: json) |
Implementation Reference
- src/index.ts:954-979 (handler)Primary handler function for the 'get_blood_expression' tool. It validates the input arguments using isValidGeneArgs, fetches the blood expression data via fetchBloodExpression, and returns the JSON-formatted result or an error response.private async handleGetBloodExpression(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchBloodExpression(args.gene); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching blood expression: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; }
- src/index.ts:513-520 (schema)Input schema defining the parameters for the get_blood_expression tool: requires a 'gene' string and optional 'format' enum.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:510-521 (registration)Registration of the get_blood_expression tool in the ListToolsRequestSchema response, including name, description, and input schema.{ name: 'get_blood_expression', description: 'Get blood cell 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:680-681 (registration)Dispatch registration in the CallToolRequestSchema switch statement that routes calls to the handleGetBloodExpression method.case 'get_blood_expression': return this.handleGetBloodExpression(args);
- src/index.ts:763-766 (helper)Helper function that queries the Protein Atlas API for blood expression data using specific blood-related columns and delegates to searchProteins.private async fetchBloodExpression(gene: string): Promise<any> { const columns = ['g', 'eg', 'rnabcs', 'rnabcd', 'rnabcss', 'blood_RNA_basophil', 'blood_RNA_classical_monocyte', 'blood_RNA_eosinophil', 'blood_RNA_neutrophil', 'blood_RNA_NK-cell']; return this.searchProteins(gene, 'json', columns, 1); }