Skip to main content
Glama

get_protein_features

Retrieve functional features and domains for a protein using its UniProt accession number. Identify key characteristics to understand protein structure and function.

Instructions

Get functional features and domains for a protein

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • Handler function that retrieves protein data from UniProt API and extracts specific features such as domains, active sites, binding sites, comments, and keywords.
    private async handleGetProteinFeatures(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid protein features arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); // Extract features and domains from the response const protein = response.data; const features = { accession: protein.primaryAccession, name: protein.uniProtkbId, features: protein.features || [], comments: protein.comments || [], keywords: protein.keywords || [], domains: protein.features?.filter((f: any) => f.type === 'Domain') || [], activeSites: protein.features?.filter((f: any) => f.type === 'Active site') || [], bindingSites: protein.features?.filter((f: any) => f.type === 'Binding site') || [], }; return { content: [ { type: 'text', text: JSON.stringify(features, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein features: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema defining the required 'accession' parameter for the tool.
    name: 'get_protein_features', description: 'Get functional features and domains for a protein', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], },
  • src/index.ts:737-737 (registration)
    Registration in the tool dispatcher switch statement that routes calls to the handler.
    return this.handleGetProteinFeatures(args);
  • src/index.ts:452-461 (registration)
    Tool registration in the ListToolsRequestSchema response, including name, description, and schema.
    name: 'get_protein_features', description: 'Get functional features and domains for a protein', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
  • Type guard function used for input validation in the handler, checking 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