Skip to main content
Glama

get_external_references

Retrieve external database links (PDB, EMBL, RefSeq, etc.) for a given UniProt accession number using the UniProt MCP Server.

Instructions

Links to other databases (PDB, EMBL, RefSeq, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function that implements the get_external_references tool. Fetches UniProt protein data via API and extracts and categorizes cross-references to external databases like PDB, EMBL, RefSeq, etc.
    private async handleGetExternalReferences(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid external references arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const externalRefs = { accession: protein.primaryAccession, allReferences: protein.uniProtKBCrossReferences || [], pdbReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'PDB') || [], emblReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'EMBL') || [], refseqReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'RefSeq') || [], ensemblReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'Ensembl') || [], goReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'GO') || [], }; return { content: [ { type: 'text', text: JSON.stringify(externalRefs, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching external references: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • src/index.ts:774-774 (registration)
    Registration of the get_external_references tool in the CallToolRequestSchema switch statement, dispatching to the handler.
    return this.handleGetExternalReferences(args);
  • Tool schema definition including input schema, registered in the ListToolsRequestSchema response.
    name: 'get_external_references', description: 'Links to other databases (PDB, EMBL, RefSeq, etc.)', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
  • Validation helper function used by get_external_references handler to validate input arguments (reused across multiple tools).
    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