---
name: phi-fold
description: "Fold one or more protein sequences on Dyno Phi and report the structure with its confidence. Use when a person gives amino-acid sequences and wants a structure, a complex, pLDDT, pTM, ipTM or PAE, or asks which folding model to use. Phi routes one chain to ESMFold 2, a complex to AlphaFold 2, and ligands, DNA, RNA or affinity to Boltz-2; the tools are phi_fold_structure, phi_job_status and phi_job_results, or the phi CLI and the Python client."
license: MIT
access: general
metadata:
  author: dynotx
  version: "1.2"
  updated: "2026-10-18"
  models: "ESMFOLD2 ALPHAFOLD BOLTZ2 ESMFOLD CHAI1 OPENFOLD3 PROTENIX"
  prompt: "true"
---

# Fold a sequence

Use this skill when the person gives one or more amino-acid sequences and wants a structure or its confidence.

## Before you start

- One sequence per chain, amino-acid letters only. Write a complex as the chains joined with `:`.
- A Phi session: the web app, the MCP connector signed in with a Dyno account, or an API key. A fold spends the organization's credits, so price it with `dry_run: true` when cost matters.

## Steps

1. Call `phi_fold_structure` with `sequences` and leave `model` unset. Phi routes one protein chain to ESMFold 2, two or more chains to AlphaFold 2, and any request with a ligand, DNA, RNA or affinity to Boltz-2. Set `model` only when the person names one.
2. Poll `phi_job_status` at the `poll_after_seconds` the response gives. A single chain finishes in a few minutes; a large complex takes longer.
3. When the status is `COMPLETED`, read `phi_job_results`. Structures come back as resource links with time-limited URLs, so download them before reporting.
4. Report mean pLDDT and pTM, and for a complex ipTM, ipSAE and iPAE, as the runner wrote them. Per-residue pLDDT is in the PDB's B-factor column; use it to say which regions are confident and which are not.

From the CLI, the same fold is one command:

```bash
phi jobs submit ESMFOLD2 --input sequences=@seqs.fasta --wait --out results
```

From Python:

```python
with PhiClient() as phi:
    job = phi.jobs.submit("ESMFOLD2", inputs={"sequences": [sequence]})
    phi.jobs.wait(job.job_id)
    phi.artifacts.download(phi.artifacts.list(job.job_id, suffix=".pdb"), "results")
```

## When it fails

- `FAILED` or `ERROR`: read the job's `error`, say what happened in one sentence, and propose one change (a cleaned sequence, a shorter construct, another model). Do not resubmit the same request unchanged.
- A 402: the organization has too few credits. Say what the fold needs and what is available, then stop.
- A 429: wait for `Retry-After` and try once more. The person never needs to hear about it.

## Rules

- Say which model folded the sequence and why.
- Quote only the metrics the runner wrote. Never compute or estimate confidence yourself.
