get_protein_interactions
Discover protein-protein interaction networks by entering a UniProt accession number. Analyze molecular relationships to advance biological research.
Instructions
Protein-protein interaction networks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes | UniProt accession number |
Implementation Reference
- src/index.ts:1401-1439 (handler)Main handler function for the 'get_protein_interactions' tool. Fetches UniProt protein data and extracts interaction-related information including STRING/IntAct references and interaction/subunit comments.private async handleGetProteinInteractions(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid protein interactions arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const interactionInfo = { accession: protein.primaryAccession, stringReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'STRING') || [], intactReferences: protein.uniProtKBCrossReferences?.filter((ref: any) => ref.database === 'IntAct') || [], interactionComments: protein.comments?.filter((c: any) => c.commentType === 'INTERACTION') || [], subunitComments: protein.comments?.filter((c: any) => c.commentType === 'SUBUNIT') || [], }; return { content: [ { type: 'text', text: JSON.stringify(interactionInfo, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein interactions: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:569-579 (registration)Tool registration in the ListTools response, including name, description, and input schema definition.{ name: 'get_protein_interactions', description: 'Protein-protein interaction networks', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
- src/index.ts:759-760 (registration)Dispatch case in the CallToolRequestSchema switch statement that routes to the handler.case 'get_protein_interactions': return this.handleGetProteinInteractions(args);
- src/index.ts:79-89 (schema)Input validation type guard used by the handler to validate arguments (shared with get_protein_info).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)) ); };