Skip to main content
Glama

get_taxonomy_info

Retrieve detailed taxonomic information for organisms using a UniProt accession number to identify and classify species accurately.

Instructions

Detailed taxonomic information for organisms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function that executes the get_taxonomy_info tool. It validates input, fetches protein data from UniProt API, extracts organism taxonomy details (scientific name, common name, taxon ID, 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, }; } }
  • src/index.ts:709-719 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema requiring a UniProt accession.
    { name: 'get_taxonomy_info', description: 'Detailed taxonomic information for organisms', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
  • src/index.ts:784-785 (registration)
    Dispatch in the CallToolRequestSchema switch statement that routes tool calls to the handler.
    case 'get_taxonomy_info': return this.handleGetTaxonomyInfo(args);
  • Type guard function used for input validation in get_taxonomy_info and similar tools, checking accession string and optional format.
    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