Skip to main content
Glama

get_taxonomy_info

Retrieve detailed taxonomic information for organisms using UniProt accession numbers to identify species classification and relationships.

Instructions

Detailed taxonomic information for organisms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function for 'get_taxonomy_info' that validates input, fetches protein data from UniProt API, extracts taxonomy details (organism, taxonomy ID, names, lineage), and returns formatted JSON.
    private async handleGetTaxonomyInfo(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid taxonomy info arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const taxonomyInfo = { accession: protein.primaryAccession, organism: protein.organism, taxonomyId: protein.organism?.taxonId, scientificName: protein.organism?.scientificName, commonName: protein.organism?.commonName, lineage: protein.organism?.lineage || [], taxonomicDivision: protein.organism?.lineage?.[0] || 'Unknown', }; return { content: [ { type: 'text', text: JSON.stringify(taxonomyInfo, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching taxonomy info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the 'get_taxonomy_info' tool, specifying the required 'accession' parameter.
    inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'],
  • src/index.ts:784-785 (registration)
    Registration/dispatch in the CallToolRequestHandler switch statement that calls the handler for 'get_taxonomy_info'.
    case 'get_taxonomy_info': return this.handleGetTaxonomyInfo(args);
  • src/index.ts:709-719 (registration)
    Tool registration in ListToolsRequestHandler, defining name, description, and input schema for 'get_taxonomy_info'.
    { name: 'get_taxonomy_info', description: 'Detailed taxonomic information for organisms', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
  • Validation helper function used by 'get_taxonomy_info' handler to check input arguments.
    const isValidProteinInfoArgs = ( args: any ): args is { accession: string; format?: string } => { return ( typeof args === 'object' && args !== null && typeof args.accession === 'string' && args.accession.length > 0 && (args.format === undefined || ['json', 'tsv', 'fasta', 'xml'].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/UniProt-MCP-Server'

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