Skip to main content
Glama

get_protein_sequence

Retrieve amino acid sequences for proteins using UniProt accession numbers. Supports FASTA or JSON output formats.

Instructions

Get the amino acid sequence for a protein

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number
formatNoOutput format (default: fasta)

Implementation Reference

  • The main handler function that validates input and fetches the protein sequence from the UniProt API endpoint `/uniprotkb/{accession}` in the specified format (default: fasta), returning the sequence data or error.
    private async handleGetProteinSequence(args: any) {
      if (!isValidSequenceArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid sequence arguments');
      }
    
      try {
        const format = args.format || 'fasta';
        const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, {
          params: { format },
        });
    
        return {
          content: [
            {
              type: 'text',
              text: format === 'json'
                ? JSON.stringify(response.data, null, 2)
                : String(response.data),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching sequence: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:440-450 (registration)
    Registration of the 'get_protein_sequence' tool in the ListTools response, including its description and input schema definition.
      name: 'get_protein_sequence',
      description: 'Get the amino acid sequence for a protein',
      inputSchema: {
        type: 'object',
        properties: {
          accession: { type: 'string', description: 'UniProt accession number' },
          format: { type: 'string', enum: ['fasta', 'json'], description: 'Output format (default: fasta)' },
        },
        required: ['accession'],
      },
    },
  • src/index.ts:734-735 (registration)
    Dispatcher case in the CallToolRequestSchema handler that routes calls to the handleGetProteinSequence method.
    case 'get_protein_sequence':
      return this.handleGetProteinSequence(args);
  • Input validation function (type guard) for the get_protein_sequence tool arguments, ensuring valid accession and optional format.
    const isValidSequenceArgs = (
      args: any
    ): args is { accession: string; format?: 'fasta' | 'json' } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.accession === 'string' &&
        args.accession.length > 0 &&
        (args.format === undefined || ['fasta', 'json'].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 states what the tool does but reveals nothing about behavioral traits: no information about rate limits, authentication requirements, error conditions, response format details beyond format parameter, or whether this is a read-only operation. The description is minimal and lacks essential operational context.

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, clear sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple retrieval tool and is perfectly front-loaded with the core functionality.

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 insufficiently complete. For a tool with 2 parameters and no structured output documentation, the description should provide more context about what the response contains, error conditions, or usage constraints. It leaves too much undefined for proper agent understanding.

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 already documents both parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain accession format requirements or when to choose different output formats. This meets the baseline for high schema coverage.

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 ('Get') and resource ('amino acid sequence for a protein'), making the purpose immediately understandable. It distinguishes this from siblings like 'get_protein_info' or 'get_protein_structure' by specifying the sequence aspect. However, it doesn't explicitly differentiate from 'batch_protein_lookup' which might also retrieve sequences.

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' (which might include sequence), 'batch_protein_lookup', and 'search_proteins', there's no indication of when this specific sequence-fetching tool is preferred or what its limitations are.

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