Skip to main content
Glama

get_protein_structure

Retrieve 3D protein structure data from PDB using a UniProt accession number to analyze and visualize molecular configurations.

Instructions

Retrieve 3D structure information from PDB references

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function that implements the get_protein_structure tool. Fetches protein data from UniProt API and extracts PDB cross-references, structural features (helix, strand, etc.), and subunit comments.
    private async handleGetProteinStructure(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid protein structure arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const structureInfo = { accession: protein.primaryAccession, pdbReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'PDB') || [], structuralFeatures: protein.features?.filter((f: any) => ['Secondary structure', 'Turn', 'Helix', 'Beta strand'].includes(f.type) ) || [], structuralComments: protein.comments?.filter((c: any) => c.commentType === 'SUBUNIT') || [], }; return { content: [ { type: 'text', text: JSON.stringify(structureInfo, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein structure: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • src/index.ts:513-522 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: 'get_protein_structure', description: 'Retrieve 3D structure information from PDB references', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], },
  • src/index.ts:748-749 (registration)
    Dispatch case in the CallToolRequest handler that routes to the tool's handler function.
    case 'get_protein_structure': return this.handleGetProteinStructure(args);
  • Input validation function used by get_protein_structure (and others) to validate accession 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