Skip to main content
Glama

get_brain_expression

Retrieve protein expression data across brain regions using a specified gene symbol. Output available in JSON or TSV format for analysis and research purposes.

Instructions

Get brain region expression data for a protein

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (default: json)
geneYesGene symbol

Implementation Reference

  • Main handler function for executing the get_brain_expression tool. Validates input using isValidGeneArgs, calls fetchBrainExpression helper, formats result as JSON text content, handles errors.
    private async handleGetBrainExpression(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchBrainExpression(args.gene); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching brain expression: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; }
  • Core helper that queries the Protein Atlas API for brain-specific expression data by selecting relevant columns like brain_RNA_* and calling the general searchProteins method.
    private async fetchBrainExpression(gene: string): Promise<any> { const columns = ['g', 'eg', 'rnabrs', 'rnabrd', 'rnabrss', 'brain_RNA_amygdala', 'brain_RNA_cerebellum', 'brain_RNA_cerebral_cortex', 'brain_RNA_hippocampal_formation', 'brain_RNA_hypothalamus']; return this.searchProteins(gene, 'json', columns, 1); }
  • src/index.ts:522-533 (registration)
    Tool registration in the ListToolsRequestHandler response, defining the tool name, description, and input schema requiring a gene symbol.
    { name: 'get_brain_expression', description: 'Get brain region 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'], }, },
  • Dispatch case in the main CallToolRequestHandler switch statement that routes get_brain_expression calls to the handler function.
    case 'get_brain_expression': return this.handleGetBrainExpression(args);
  • Input validation type guard used by the handler to ensure args has a valid gene string and optional format.
    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)) ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Augmented-Nature/ProteinAtlas-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server