Skip to main content
Glama

search_proteins

Identify proteins by name or identifier across species. Specify a search query (protein or gene name) and optionally filter by species or limit results. Access data via the STRING-db MCP Server.

Instructions

Search for proteins by name or identifier across species

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results (default: 10)
queryYesSearch query (protein name, gene name, or identifier)
speciesNoSpecies name or NCBI taxonomy ID (optional)

Implementation Reference

  • The handler function that executes the search_proteins tool: validates input, queries STRING API endpoint /tsv/get_string_ids, parses TSV data, formats and returns protein search results as JSON.
    private async handleSearchProteins(args: any) { if (!isValidSearchArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid search arguments'); } try { const species = args.species || ''; const limit = args.limit || 10; const params: any = { identifiers: args.query, limit: limit, }; if (species) { params.species = species; } const response = await this.apiClient.get('/tsv/get_string_ids', { params }); const results = this.parseTsvData<ProteinAnnotation>(response.data); return { content: [ { type: 'text', text: JSON.stringify({ query: args.query, species_filter: species || 'all', total_results: results.length, proteins: results.map(protein => ({ 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 searching proteins: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the search_proteins tool specifying required 'query' parameter and optional 'species' and 'limit'.
    inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query (protein name, gene name, or identifier)' }, species: { type: 'string', description: 'Species name or NCBI taxonomy ID (optional)' }, limit: { type: 'number', description: 'Maximum number of results (default: 10)', minimum: 1, maximum: 100 }, }, required: ['query'], },
  • src/index.ts:375-387 (registration)
    Tool registration in the MCP ListTools response, including name, description, and schema.
    { name: 'search_proteins', description: 'Search for proteins by name or identifier across species', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query (protein name, gene name, or identifier)' }, species: { type: 'string', description: 'Species name or NCBI taxonomy ID (optional)' }, limit: { type: 'number', description: 'Maximum number of results (default: 10)', minimum: 1, maximum: 100 }, }, required: ['query'], }, },
  • src/index.ts:405-406 (registration)
    Dispatcher case in CallToolRequestSchema handler that routes search_proteins calls to the handler function.
    case 'search_proteins': return this.handleSearchProteins(args);
  • Validation helper function isValidSearchArgs used in the handler to check input parameters.
    const isValidSearchArgs = ( args: any ): args is { query: string; species?: string; limit?: number } => { return ( typeof args === 'object' && args !== null && typeof args.query === 'string' && args.query.length > 0 && (args.species === undefined || typeof args.species === 'string') && (args.limit === undefined || (typeof args.limit === 'number' && args.limit > 0 && args.limit <= 100)) ); };

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