get_annotation_confidence
Retrieve confidence scores for UniProt annotations using a specific accession number to assess the reliability of protein data.
Instructions
Quality scores for different annotations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes | UniProt accession number |
Implementation Reference
- src/index.ts:1778-1817 (handler)The handler function for the 'get_annotation_confidence' tool. Fetches protein data from UniProt API and extracts key confidence indicators such as entryType, proteinExistence, annotationScore, evidence codes, review status, and number of references.private async handleGetAnnotationConfidence(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid annotation confidence arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const protein = response.data; const confidenceInfo = { accession: protein.primaryAccession, entryType: protein.entryType, proteinExistence: protein.proteinExistence, annotationScore: protein.annotationScore || 'Not available', evidenceCodes: protein.features?.map((f: any) => f.evidences).flat().filter(Boolean) || [], reviewStatus: protein.entryType === 'UniProtKB reviewed (Swiss-Prot)' ? 'Reviewed' : 'Unreviewed', referenceCount: protein.references?.length || 0, }; return { content: [ { type: 'text', text: JSON.stringify(confidenceInfo, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching annotation confidence: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; }
- src/index.ts:777-778 (registration)Switch case in CallToolRequestSchema handler that routes 'get_annotation_confidence' tool calls to the appropriate handler method.case 'get_annotation_confidence': return this.handleGetAnnotationConfidence(args);
- src/index.ts:675-684 (registration)Tool registration in ListToolsRequestSchema response, including name, description, and input schema definition.name: 'get_annotation_confidence', description: 'Quality scores for different annotations', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
- src/index.ts:678-684 (schema)Input schema for the get_annotation_confidence tool, requiring a UniProt accession string.type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, }, required: ['accession'], }, },
- src/index.ts:79-89 (helper)Shared validation function for protein info tool arguments, including accession validation, used by get_annotation_confidence 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)) ); };