Skip to main content
Glama

get_external_references

Retrieve cross-references from UniProt entries to external databases like PDB, EMBL, and RefSeq by providing an accession number.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function for the 'get_external_references' tool. It validates the accession input, fetches the UniProtKB entry via API, extracts cross-references (uniProtKBCrossReferences), categorizes them by database (PDB, EMBL, RefSeq, Ensembl, GO), and returns structured JSON.
    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-775 (registration)
    Registers and dispatches the 'get_external_references' tool call to its handler within the CallToolRequestSchema switch statement.
    return this.handleGetExternalReferences(args); case 'get_literature_references':
  • Tool metadata and input schema definition returned by ListToolsRequestSchema, specifying the name, description, and required 'accession' parameter.
    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'], }, },
  • Input validation helper function used by the get_external_references handler to validate the accession argument.
    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