Skip to main content
Glama

get_subcellular_location

Retrieve subcellular localization data for a protein using a gene symbol. Supports output in JSON or TSV format, aiding in protein research and analysis.

Instructions

Get subcellular localization data for a protein

Input Schema

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

Implementation Reference

  • The primary handler function for the 'get_subcellular_location' tool. Validates input using isValidGeneArgs, fetches data via fetchSubcellularLocalization helper, formats as JSON response or 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, }; } }
  • Tool schema definition including name, description, and inputSchema for validation (gene symbol required, optional format). Part of tools list registration.
    { 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)
    Registration/dispatch in the CallToolRequestHandler switch statement, routing calls to the handler function.
    case 'get_subcellular_location': return this.handleGetSubcellularLocation(args);
  • Helper method that performs the API query for subcellular location data, selecting specific columns like scl (subcell location), scml, etc., and limits to 1 result.
    private async fetchSubcellularLocalization(gene: string): Promise<any> { const columns = ['g', 'eg', 'scl', 'scml', 'scal', 'relce']; return this.searchProteins(gene, 'json', columns, 1); }
  • Type guard/validation function for gene-based tool arguments, ensuring valid gene string and optional format. Used by the handler.
    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