Skip to main content
Glama

batch_protein_lookup

Retrieve protein data for multiple UniProt accessions at once in JSON, TSV, or FASTA format to analyze up to 100 entries efficiently.

Instructions

Process multiple accessions efficiently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionsYesArray of UniProt accession numbers (1-100)
formatNoOutput format (default: json)

Implementation Reference

  • The handler function that implements the batch_protein_lookup tool. It validates input, processes accessions in chunks of 10 using Promise.all for parallel API calls to UniProt, collects results or errors per accession, and returns formatted JSON output.
    private async handleBatchProteinLookup(args: any) {
      if (!isValidBatchLookupArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid batch lookup arguments');
      }
    
      try {
        const results = [];
    
        // Process in chunks to avoid API limits
        const chunkSize = 10;
        for (let i = 0; i < args.accessions.length; i += chunkSize) {
          const chunk = args.accessions.slice(i, i + chunkSize);
          const chunkResults = await Promise.all(
            chunk.map(async (accession: string) => {
              try {
                const response = await this.apiClient.get(`/uniprotkb/${accession}`, {
                  params: { format: args.format || 'json' },
                });
                return { accession, data: response.data, success: true };
              } catch (error) {
                return { accession, error: error instanceof Error ? error.message : 'Unknown error', success: false };
              }
            })
          );
          results.push(...chunkResults);
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ batchResults: results }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error in batch lookup: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema definition for the batch_protein_lookup tool, specifying accessions array (1-100 strings) and optional format.
    inputSchema: {
      type: 'object',
      properties: {
        accessions: { type: 'array', items: { type: 'string' }, description: 'Array of UniProt accession numbers (1-100)', minItems: 1, maxItems: 100 },
        format: { type: 'string', enum: ['json', 'tsv', 'fasta'], description: 'Output format (default: json)' },
      },
      required: ['accessions'],
  • src/index.ts:608-619 (registration)
    Registration of the batch_protein_lookup tool in the ListToolsRequestSchema response, including name, description, and schema.
    {
      name: 'batch_protein_lookup',
      description: 'Process multiple accessions efficiently',
      inputSchema: {
        type: 'object',
        properties: {
          accessions: { type: 'array', items: { type: 'string' }, description: 'Array of UniProt accession numbers (1-100)', minItems: 1, maxItems: 100 },
          format: { type: 'string', enum: ['json', 'tsv', 'fasta'], description: 'Output format (default: json)' },
        },
        required: ['accessions'],
      },
    },
  • src/index.ts:766-767 (registration)
    Dispatch/registration of the handler in the CallToolRequestSchema switch statement.
    case 'batch_protein_lookup':
      return this.handleBatchProteinLookup(args);
  • Helper function to validate the input arguments for batch_protein_lookup, checking accessions array length and format.
    const isValidBatchLookupArgs = (
      args: any
    ): args is { accessions: string[]; format?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        Array.isArray(args.accessions) &&
        args.accessions.length > 0 &&
        args.accessions.length <= 100 &&
        args.accessions.every((acc: any) => typeof acc === 'string' && acc.length > 0) &&
        (args.format === undefined || ['json', 'tsv', 'fasta'].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 the full burden. 'Process multiple accessions efficiently' implies a read operation but lacks details on behavior: it doesn't specify what data is returned, any rate limits, error handling for invalid accessions, or performance characteristics. This is inadequate for a tool with no annotation coverage.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it's under-specified rather than optimally structured, as it could benefit from front-loading more specific information about the tool's purpose.

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 for a tool that likely returns protein-related data. It doesn't explain what 'process' yields (e.g., protein info, sequences), leaving gaps in understanding the tool's behavior and output, which is insufficient for 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 both parameters (accessions array with constraints, format enum with default). The description adds no meaning beyond this, as it doesn't explain parameter usage or semantics. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Process multiple accessions efficiently' states the verb ('process') and resource ('multiple accessions'), but it's vague about what processing entails compared to siblings like 'get_protein_info' or 'get_protein_sequence'. It doesn't specify if this returns protein data, sequences, or annotations, leaving ambiguity in distinguishing its exact function from similar tools.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_protein_info' and 'get_protein_sequence', it's unclear if this tool is for batch retrieval of general info, sequences, or something else, and there are no explicit when/when-not instructions or named alternatives mentioned.

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