get_sequence
Retrieve protein sequence metadata from UniProtKB database using accession numbers to access biological sequence information.
Instructions
Return only the sequence metadata for an accession.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes |
Implementation Reference
- src/uniprot_mcp/server.py:133-143 (handler)The main handler function for the 'get_sequence' tool. It normalizes the accession, fetches the sequence JSON from UniProt, and parses it into a Sequence object. Registered via @mcp.tool() decorator.@mcp.tool() # type: ignore[misc] async def get_sequence(accession: str) -> Sequence | None: """Return only the sequence metadata for an accession.""" normalized = _validate_accession(accession) async with new_client() as client: payload = await fetch_sequence_json(client, normalized) if not payload: return None return parse_sequence_from_entry(payload)