Skip to main content
Glama

get_annotation_confidence

Retrieve quality scores for UniProt protein annotations to assess reliability and support data-driven decisions in biological research.

Instructions

Quality scores for different annotations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The main handler function for the 'get_annotation_confidence' tool. Validates input, fetches UniProt protein data via API, extracts quality metrics like entryType, proteinExistence, annotationScore, evidence codes, review status, and reference count, then returns formatted JSON.
    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)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement, routing calls to the specific handler function.
    case 'get_annotation_confidence':
      return this.handleGetAnnotationConfidence(args);
  • src/index.ts:674-684 (registration)
    Tool registration in the ListToolsRequestSchema response, defining name, description, and input schema.
    {
      name: 'get_annotation_confidence',
      description: 'Quality scores for different annotations',
      inputSchema: {
        type: 'object',
        properties: {
          accession: { type: 'string', description: 'UniProt accession number' },
        },
        required: ['accession'],
      },
    },
  • Input schema definition for the tool, specifying required 'accession' parameter of type string.
    inputSchema: {
      type: 'object',
      properties: {
        accession: { type: 'string', description: 'UniProt accession number' },
      },
      required: ['accession'],
    },
  • Input validation helper function used by the handler to check if arguments contain a valid accession (reused across multiple tools). Note: format validation is present but not used in this tool.
    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