Skip to main content
Glama

search_proteins

Search the Human Protein Atlas database to find proteins using gene names, protein names, or descriptive keywords. Retrieve detailed expression and localization data in JSON or TSV format.

Instructions

Search Human Protein Atlas for proteins by name, gene symbol, or description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (gene name, protein name, or keyword)
formatNoOutput format (default: json)
columnsNoSpecific columns to include in results
maxResultsNoMaximum number of results (1-10000, default: 100)
compressNoWhether to compress the response (default: false)

Implementation Reference

  • MCP tool handler for 'search_proteins': validates input using isValidSearchArgs, calls the core searchProteins method, formats response as MCP content or error.
    private async handleSearchProteins(args: any) { if (!isValidSearchArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid search arguments'); } try { const result = await this.searchProteins(args.query, args.format || 'json', args.columns, args.maxResults); return { content: [ { type: 'text', text: typeof result === 'object' ? JSON.stringify(result, null, 2) : String(result), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error searching proteins: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Core implementation: performs HTTP GET to Protein Atlas search API with query params, handles JSON/TSV formats, uses default columns for basic info.
    private async searchProteins(query: string, format: string = 'json', columns?: string[], maxResults?: number): Promise<any> { // Default columns if none provided - basic protein information const defaultColumns = ['g', 'gs', 'eg', 'gd', 'up', 'chr', 'pc', 'pe']; const searchColumns = columns && columns.length > 0 ? columns : defaultColumns; const params: any = { search: query, format: format, columns: searchColumns.join(','), compress: 'no', }; const response = await this.apiClient.get('/api/search_download.php', { params }); if (format === 'json') { return this.parseResponse(response.data, format); } return response.data; }
  • src/index.ts:444-458 (registration)
    Tool registration in ListToolsRequestHandler: defines name, description, and detailed inputSchema for MCP tool discovery.
    { name: 'search_proteins', description: 'Search Human Protein Atlas for proteins by name, gene symbol, or description', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query (gene name, protein name, or keyword)' }, format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' }, columns: { type: 'array', items: { type: 'string' }, description: 'Specific columns to include in results' }, maxResults: { type: 'number', description: 'Maximum number of results (1-10000, default: 100)', minimum: 1, maximum: 10000 }, compress: { type: 'boolean', description: 'Whether to compress the response (default: false)' }, }, required: ['query'], }, },
  • Type guard function for validating input arguments to search_proteins tool, matching the registered inputSchema.
    const isValidSearchArgs = ( args: any ): args is { query: string; format?: string; columns?: string[]; compress?: boolean; maxResults?: number; } => { return ( typeof args === 'object' && args !== null && typeof args.query === 'string' && args.query.length > 0 && (args.format === undefined || ['json', 'tsv', 'xml', 'trig'].includes(args.format)) && (args.columns === undefined || Array.isArray(args.columns)) && (args.compress === undefined || typeof args.compress === 'boolean') && (args.maxResults === undefined || (typeof args.maxResults === 'number' && args.maxResults > 0 && args.maxResults <= 10000)) ); };

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