get_protein_domains_detailed
Retrieve detailed protein domain information from UniProt using InterPro, Pfam, and SMART annotations to analyze functional regions.
Instructions
Enhanced domain analysis with InterPro, Pfam, and SMART annotations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes | UniProt accession number |
Implementation Reference
- src/index.ts:1219-1259 (handler)The handler function that executes the tool: fetches UniProtKB entry for the given accession, extracts domains, regions, repeats from features, and InterPro/Pfam/SMART cross-references, returns formatted JSON.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, }; } }
- src/index.ts:525-534 (schema)Input schema definition for the tool as registered in ListToolsRequestHandler.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)Tool handler registration in the CallToolRequestSchema switch statement.case 'get_protein_domains_detailed': return this.handleGetProteinDomainsDetailed(args);
- src/index.ts:79-89 (helper)Shared validation function for protein accession arguments, used in the handler.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)) ); };