Skip to main content
Glama

get_protein_domains_detailed

Analyze protein domains using InterPro, Pfam, and SMART annotations by providing a UniProt accession number for detailed domain insights.

Instructions

Enhanced domain analysis with InterPro, Pfam, and SMART annotations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The handler function that executes the tool logic: fetches protein data from UniProt API and extracts detailed domains, regions, repeats, and cross-references to InterPro, Pfam, SMART.
    private async handleGetProteinDomainsDetailed(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid protein domains arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const domainInfo = { accession: protein.primaryAccession, domains: protein.features?.filter((f: any) => f.type === 'Domain') || [], regions: protein.features?.filter((f: any) => f.type === 'Region') || [], repeats: protein.features?.filter((f: any) => f.type === 'Repeat') || [], interproReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'InterPro') || [], pfamReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'Pfam') || [], smartReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'SMART') || [], }; return { content: [ { type: 'text', text: JSON.stringify(domainInfo, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein domains: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the tool: requires a string 'accession' parameter.
    inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], },
  • src/index.ts:524-534 (registration)
    Registration of the tool in the ListToolsRequestSchema response, including name, description, and schema.
    { name: 'get_protein_domains_detailed', description: 'Enhanced domain analysis with InterPro, Pfam, and SMART annotations', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
  • src/index.ts:750-751 (registration)
    Dispatch to the tool handler in the CallToolRequestSchema switch statement.
    case 'get_protein_domains_detailed': return this.handleGetProteinDomainsDetailed(args);
  • Input validation helper function used by the handler to check arguments.
    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