Skip to main content
Glama

get_subcellular_location

Retrieve subcellular localization data for proteins to understand their cellular distribution and function using Human Protein Atlas information.

Instructions

Get subcellular localization data for a protein

Input Schema

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

Implementation Reference

  • The main handler function for the 'get_subcellular_location' tool. Validates input using isValidGeneArgs, fetches data via fetchSubcellularLocalization, and returns JSON-formatted subcellular location data or an error.
    private async handleGetSubcellularLocation(args: any) { if (!isValidGeneArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid gene arguments'); } try { const result = await this.fetchSubcellularLocalization(args.gene); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching subcellular location: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the tool, specifying 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:535-546 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema.
    { name: 'get_subcellular_location', description: 'Get subcellular localization 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:685-686 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that routes to the handler.
    case 'get_subcellular_location': return this.handleGetSubcellularLocation(args);
  • Helper method that fetches subcellular location data by calling searchProteins with specific columns: scl (subcell location), scml (main location), scal (additional locations), relce (reliability).
    private async fetchSubcellularLocalization(gene: string): Promise<any> { const columns = ['g', 'eg', 'scl', 'scml', 'scal', 'relce']; return this.searchProteins(gene, 'json', columns, 1); }

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