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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"accession": "<accession>"
},
"name": "get_sequence"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | 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]