Skip to main content
Glama

search_proteins

Search the UniProt database for proteins using names, keywords, or organism filters to retrieve detailed protein information in multiple formats.

Instructions

Search UniProt database for proteins by name, keyword, or organism

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (protein name, keyword, or complex search)
organismNoOrganism name or taxonomy ID to filter results
sizeNoNumber of results to return (1-500, default: 25)
formatNoOutput format (default: json)

Implementation Reference

  • Handler function that executes the search_proteins tool. Validates input, constructs UniProt search query with optional organism filter, calls the UniProt REST API, and returns JSON results or error.
    private async handleSearchProteins(args: any) {
      if (!isValidSearchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid search arguments');
      }
    
      try {
        let query = args.query;
        if (args.organism) {
          query += ` AND organism_name:"${args.organism}"`;
        }
    
        const response = await this.apiClient.get('/uniprotkb/search', {
          params: {
            query: query,
            format: args.format || 'json',
            size: args.size || 25,
          },
        });
    
              return {
                content: [
                  {
                    type: 'text',
                    text: typeof response.data === 'object'
                      ? JSON.stringify(response.data, null, 2)
                      : String(response.data),
                  },
                ],
              };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error searching proteins: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:400-412 (registration)
    Registration of the search_proteins tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    {
      name: 'search_proteins',
      description: 'Search UniProt database for proteins by name, keyword, or organism',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query (protein name, keyword, or complex search)' },
          organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
          size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
          format: { type: 'string', enum: ['json', 'tsv', 'fasta', 'xml'], description: 'Output format (default: json)' },
        },
        required: ['query'],
      },
  • src/index.ts:728-729 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that routes calls to the handleSearchProteins handler.
    case 'search_proteins':
      return this.handleSearchProteins(args);
  • Type guard function for validating input arguments to the search_proteins tool, matching the inputSchema.
    const isValidSearchArgs = (
      args: any
    ): args is { query: string; organism?: string; size?: number; format?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.query === 'string' &&
        (args.organism === undefined || typeof args.organism === 'string') &&
        (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 500)) &&
        (args.format === undefined || ['json', 'tsv', 'fasta', 'xml'].includes(args.format))
      );
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions searching a database but lacks details on rate limits, authentication needs, pagination, error handling, or what the search returns (e.g., list of proteins with basic info). This is a significant gap for a search tool with no structured behavioral hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the search returns (e.g., protein IDs, names, sequences), potential limitations, or how results are structured. For a search tool with 4 parameters and many siblings, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds minimal value beyond the schema by hinting at search criteria ('by name, keyword, or organism'), but doesn't explain parameter interactions or provide examples. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('search') and target resource ('UniProt database for proteins'), specifying search criteria ('by name, keyword, or organism'). It distinguishes from siblings like 'search_by_function' or 'search_by_gene' by mentioning general search terms, though not explicitly contrasting them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'advanced_search' or 'search_by_function' is provided. The description implies usage for basic protein searches but lacks context on prerequisites, exclusions, or comparisons to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/UniProt-MCP-Server'

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