get_protein_info
Retrieve detailed protein information from the Human Protein Atlas by entering a gene symbol. Obtain data on expression, subcellular localization, and pathology in multiple output formats.
Instructions
Get detailed information for a specific protein by gene symbol
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format (default: json) | |
| gene | Yes | Gene symbol (e.g., BRCA1, TP53) |
Implementation Reference
- src/index.ts:837-863 (handler)The primary handler function for the 'get_protein_info' tool. It validates the input arguments, fetches protein data for the given gene symbol using the helper fetchProteinData, formats the result as JSON text, and returns it in the MCP response format. Handles errors gracefully.private async handleGetProteinInfo(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchProteinData(args.gene, args.format || 'json'); return { content: [ { type: 'text', text: typeof result === 'object' ? JSON.stringify(result, null, 2) : String(result), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:462-469 (schema)Input schema defining the parameters for the get_protein_info tool: requires 'gene' string, optional 'format' enum.inputSchema: { type: 'object', properties: { gene: { type: 'string', description: 'Gene symbol (e.g., BRCA1, TP53)' }, format: { type: 'string', enum: ['json', 'tsv', 'xml', 'trig'], description: 'Output format (default: json)' }, }, required: ['gene'], },
- src/index.ts:460-470 (registration)Tool registration in the MCP tools list, including name, description, and input schema.name: 'get_protein_info', description: 'Get detailed information for a specific protein by gene symbol', inputSchema: { type: 'object', properties: { gene: { type: 'string', description: 'Gene symbol (e.g., BRCA1, TP53)' }, format: { type: 'string', enum: ['json', 'tsv', 'xml', 'trig'], description: 'Output format (default: json)' }, }, required: ['gene'], }, },
- src/index.ts:671-672 (registration)Dispatch registration in the switch statement of the CallToolRequestHandler, routing calls to the handler.case 'get_protein_info': return this.handleGetProteinInfo(args);
- src/index.ts:738-741 (helper)Helper function that fetches basic protein data by gene using the general searchProteins method with default columns and maxResults=1.private async fetchProteinData(gene: string, format: string = 'json'): Promise<any> { // Use searchProteins method which properly handles columns parameter return this.searchProteins(gene, format, undefined, 1); }