get_sequence
Retrieve protein sequence metadata from UniProtKB database by providing an accession number to access specific biological data.
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 validates the accession, fetches the sequence JSON from UniProt, and parses it into a Sequence object.@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)
- src/uniprot_mcp/server.py:133-133 (registration)The @mcp.tool() decorator registers the get_sequence function as an MCP tool.@mcp.tool() # type: ignore[misc]