get_pathology_data
Retrieve cancer and pathology data for specific proteins from the Human Protein Atlas database to support biomedical research and analysis.
Instructions
Get cancer and pathology 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:1071-1097 (handler)The main handler function for the 'get_pathology_data' tool. Validates input using isValidGeneArgs, fetches pathology data via fetchPathologyData, and returns the JSON-formatted result or an error response.private async handleGetPathologyData(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchPathologyData(args.gene); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching pathology data: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:565-572 (schema)Input schema for the 'get_pathology_data' 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:562-573 (registration)Tool registration in the tools list, specifying name, description, and input schema for MCP server.setTools.{ name: 'get_pathology_data', description: 'Get cancer and pathology 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:690-691 (registration)Dispatcher switch case in the CallToolRequestHandler that routes 'get_pathology_data' calls to the handler method.case 'get_pathology_data': return this.handleGetPathologyData(args);
- src/index.ts:758-761 (helper)Helper method that performs the core data fetch for pathology data by calling searchProteins with specific prognostic columns.private async fetchPathologyData(gene: string): Promise<any> { const columns = ['g', 'eg', 'prognostic_Breast_Invasive_Carcinoma_(TCGA)', 'prognostic_Colon_Adenocarcinoma_(TCGA)', 'prognostic_Lung_Adenocarcinoma_(TCGA)', 'prognostic_Prostate_Adenocarcinoma_(TCGA)']; return this.searchProteins(gene, 'json', columns, 1); }