Skip to main content
Glama

get_protein_annotations

Retrieve detailed functional annotations and protein information for specified protein IDs, tailored by species, using the STRING-db MCP Server.

Instructions

Get detailed annotations and functional information for proteins

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_idsYesList of protein identifiers
speciesNoSpecies name or NCBI taxonomy ID (default: 9606 for human)

Implementation Reference

  • The handler function that implements the get_protein_annotations tool. It validates input using isValidNetworkArgs, calls the STRING API endpoint '/tsv/get_string_ids' to fetch annotations for the given protein_ids and species, parses the TSV response using parseTsvData, and returns formatted JSON with protein details including STRING ID, preferred name, NCBI taxon ID, annotation, and protein size.
    private async handleGetProteinAnnotations(args: any) { if (!isValidNetworkArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid protein annotation arguments'); } try { const species = args.species || '9606'; const response = await this.apiClient.get('/tsv/get_string_ids', { params: { identifiers: args.protein_ids.join('%0d'), species: species, }, }); const annotations = this.parseTsvData<ProteinAnnotation>(response.data); return { content: [ { type: 'text', text: JSON.stringify({ species: species, proteins: annotations.map(protein => ({ query_id: protein.preferredName, string_id: protein.stringId, preferred_name: protein.preferredName, ncbi_taxon_id: protein.ncbiTaxonId, annotation: protein.annotation, protein_size: protein.protein_size, })) }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching protein annotations: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • The input schema definition for the get_protein_annotations tool, specifying protein_ids as required array of strings and optional species string.
    { name: 'get_protein_annotations', description: 'Get detailed annotations and functional information for proteins', inputSchema: { type: 'object', properties: { protein_ids: { type: 'array', items: { type: 'string' }, description: 'List of protein identifiers' }, species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' }, }, required: ['protein_ids'], }, },
  • src/index.ts:401-402 (registration)
    The switch case in the CallToolRequestSchema handler that registers and dispatches calls to the get_protein_annotations tool handler.
    case 'get_protein_annotations': return this.handleGetProteinAnnotations(args);
  • TypeScript interface defining the structure of protein annotation data used in the tool's response parsing.
    interface ProteinAnnotation { stringId: string; preferredName: string; ncbiTaxonId: number; annotation: string; protein_size: number; }
  • Validation function reused for input validation in get_protein_annotations (checks protein_ids array and optional fields), originally for network but compatible.
    const isValidNetworkArgs = ( args: any ): args is { protein_ids: string[]; species?: string; network_type?: string; add_nodes?: number; required_score?: number } => { return ( typeof args === 'object' && args !== null && Array.isArray(args.protein_ids) && args.protein_ids.length > 0 && args.protein_ids.every((id: any) => typeof id === 'string') && (args.species === undefined || typeof args.species === 'string') && (args.network_type === undefined || ['functional', 'physical'].includes(args.network_type)) && (args.add_nodes === undefined || (typeof args.add_nodes === 'number' && args.add_nodes >= 0 && args.add_nodes <= 100)) && (args.required_score === undefined || (typeof args.required_score === 'number' && args.required_score >= 0 && args.required_score <= 1000)) ); };

Other Tools

Related Tools

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/STRING-db-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server