Skip to main content
Glama

batch_protein_lookup

Look up multiple proteins simultaneously to retrieve Human Protein Atlas data on expression, localization, and pathology for up to 100 genes at once.

Instructions

Look up multiple proteins simultaneously

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genesYesArray of gene symbols (max 100)
formatNoOutput format (default: json)
columnsNoSpecific columns to include in results

Implementation Reference

  • The handler function for the batch_protein_lookup tool. Validates input, fetches protein data for each gene concurrently using Promise.all and fetchProteinData, collects results with success/error status, and returns formatted JSON response.
    private async handleBatchProteinLookup(args: any) { if (!isValidBatchArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid batch lookup arguments'); } try { const results = await Promise.all( args.genes.map(async (gene: string) => { try { const data = await this.fetchProteinData(gene, args.format || 'json'); return { gene, data, success: true }; } catch (error) { return { gene, error: error instanceof Error ? error.message : 'Unknown error', success: false }; } }) ); return { content: [ { type: 'text', text: JSON.stringify({ batchResults: results }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error in batch lookup: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the batch_protein_lookup tool, specifying genes array (1-100 items), optional format and columns.
    inputSchema: { type: 'object', properties: { genes: { type: 'array', items: { type: 'string' }, description: 'Array of gene symbols (max 100)', minItems: 1, maxItems: 100 }, format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' }, columns: { type: 'array', items: { type: 'string' }, description: 'Specific columns to include in results' }, }, required: ['genes'], },
  • src/index.ts:622-634 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema for batch_protein_lookup.
    { name: 'batch_protein_lookup', description: 'Look up multiple proteins simultaneously', inputSchema: { type: 'object', properties: { genes: { type: 'array', items: { type: 'string' }, description: 'Array of gene symbols (max 100)', minItems: 1, maxItems: 100 }, format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' }, columns: { type: 'array', items: { type: 'string' }, description: 'Specific columns to include in results' }, }, required: ['genes'], }, },
  • Type guard function used in the handler to validate batch_protein_lookup input arguments, checking genes array validity and optional format/columns.
    const isValidBatchArgs = ( args: any ): args is { genes: string[]; format?: string; columns?: string[] } => { return ( typeof args === 'object' && args !== null && Array.isArray(args.genes) && args.genes.length > 0 && args.genes.length <= 100 && args.genes.every((gene: any) => typeof gene === 'string' && gene.length > 0) && (args.format === undefined || ['json', 'tsv'].includes(args.format)) && (args.columns === undefined || Array.isArray(args.columns)) ); };

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