ncbi-blast-skill
oleh openai
Kirim, polling, dan rangkum pekerjaan API URL Umum NCBI BLAST (Blast.cgi) untuk sekuens nukleotida atau protein. Gunakan saat pengguna ingin status RID, hasil BLAST, atau…
npx skills add https://github.com/openai/plugins --skill ncbi-blast-skillOperating rules
- Use
scripts/ncbi_blast.pyfor all concrete BLAST work. - Honor NCBI limits:
>=10sbetween requests and>=60sbetween polls for the same RID. - Always surface the
RIDin the response so the job can be resumed or refetched later. - If the conversation is long or multiple tool calls have occurred, refetch from the
RIDinstead of trusting older context. - If a prior turn saved raw output to disk, do not read it back into context unless the user asks for a specific follow-up.
Execution behavior
- Return compact BLAST summaries first.
- Do not paste full
JSON2or long Text alignments into chat by default. - Default to
max_hits=5andmax_queries=5. - If the user asks for raw output, write it to a file and report the path.
- Only provide Python code when the user explicitly asks for code or execution is unavailable.
- For normal user-facing answers, summarize the script JSON in markdown; if the user explicitly asks for machine-readable output, return the JSON verbatim.
Input
- The script reads one JSON object from stdin.
actionmust be one ofsubmit,status,fetch, orrun.submitandrunrequireprogram,database,query_fasta, andemail(orNCBI_EMAIL).statusandfetchrequirerid.programmust be one ofblastn,blastp,blastx,tblastn, ortblastx.result_formatdefaults tojson2forrunandfetch.tooldefaults toNCBI_TOOL, thenncbi-blast-skill.max_hitsdefaults to5;max_queriesdefaults to5.hitlist_sizedefaults to50;descriptionsandalignmentsdefault to5.wait_timeout_secdefaults to900.save_rawdefaults tofalse.- If
save_raw=trueandraw_output_pathis omitted, the script writes to/tmp/ncbi-blast-<rid>.<json|txt>. query_fastamay contain multi-FASTA input; compact summaries still cap per-query output withmax_hitsandmax_queries.
Output
- Common success fields:
ok,source,action,warnings. submitreturnsrid,rtoe_seconds, andstatus="SUBMITTED".statusreturnsrid, normalizedstatus, andhas_hits.runandfetchwithresult_format=json2returnrid,status,has_hits,result_format,query_count_returned,query_count_available,query_summaries_truncated,query_summaries, andraw_output_path.- Each
query_summarycontainsquery_title,hit_count_returned,hit_count_available,truncated, andtop_hits. - Each
top_hitcontainsrank,accession,title,evalue, andbit_score. fetchwithresult_format=textreturnstext_headcapped at 800 characters unlesssave_raw=true; whensave_raw=true, it returns only the artifact path.- Failures return
ok=false,error.code,error.message, andwarnings.
Execution
- Run
python scripts/ncbi_blast.py. - If
requestsis missing, install it once before first use withpython -m pip install requests.
echo '{"action":"run","program":"blastp","database":"swissprot","query_fasta":">q1\nMTEYK...","email":"you@example.com"}' | python scripts/ncbi_blast.py
References
- Load
references/blast-common-url-api.txtonly for parameter details or uncommon BLAST options. - Do not load
references/intent-notes.txtduring normal skill execution; it is not runtime guidance.