Terminal
Terminal/Skill
Create, run, schedule, or debug MotherDuck Flights, Python jobs executed on MotherDuck compute.
By MotherDuck
Works with
npx skills add motherduckdb/agent-skills --skill motherduck-create-flightget_flight_guide before create_flight, update_flight, or edit_flight_source. The guide defines the current authoring contract, runtime limits, and tool semantics.get_flight_guide also surfaces conventions from the reserved flights Guide topic. Apply those conventions when they fit the requested workload.MD_CREATE_FLIGHT, MD_RUN_FLIGHT, MD_LIST_FLIGHTS(), ...) that execute server-side on a MotherDuck connection. Parameter names differ slightly between the two surfaces; see the naming table in references/FLIGHTS_GUIDE.md.def main(): ... and if __name__ == "__main__": main(). No CLI args — every knob comes from env vars via config (non-secret) or TYPE flights secrets (sensitive).duckdb.connect("md:"); the runtime injects MOTHERDUCK_TOKEN automatically. Never hardcode a token in source, config, or requirements.requirements_txt. Resolve the highest MotherDuck-supported DuckDB version from https://motherduck.com/docs/duckdb-versions.json before authoring a new Flight; use the tested pin in the included templates only when reproducing those examples. An unpinned or unsupported duckdb can fail at connect.<secret_name>_<PARAM> key and, when safe, a bare <PARAM> convenience alias. Prefer namespaced keys in deployed Flight code; bare aliases can collide, be overridden by config, and are withheld for reserved runtime keys./tmp/ and read_csv_auto/read_json_auto/read_parquet, or one CTAS / INSERT ... SELECT. No executemany() against MotherDuck.CREATE OR REPLACE TABLE full refresh, partition DELETE + INSERT, or dlt write_disposition="merge" with a primary key. Bootstrap with CREATE DATABASE IF NOT EXISTS / CREATE SCHEMA IF NOT EXISTS so the first run succeeds on a fresh account.[A-Za-z_][A-Za-z0-9_]* before interpolating it into DDL; bind all data values as ? parameters.schedule_cron (5-field cron, UTC).max_runtime_sec when the workload needs an explicit cap; read the current plan limit from get_flight_guide instead of hardcoding it.access_token_name and keep its database permissions as narrow as the workload allows.get_flight_guide before sizing disk- or memory-intensive work.motherduck-query instead — no Flight needed.get_flight_guide (MCP) and confirm which database the flight writes to with motherduck-explore.references/FLIGHT_EXAMPLES.md when it fits; otherwise write a focused script that preserves the runtime, secrets, and idempotency contracts.TYPE flights secret first, then create_flight with name, source_code, pinned requirements_txt, config, and secret names — no schedule_cron yet.run_flight, poll get_flight_run when available (or list_flight_runs as a fallback) until terminal, and read get_flight_logs. Iterate with edit_flight_source (surgical) or update_flight (full field replacement); each content change creates a new version.update_flight(schedule_cron = ...) and state that cron is UTC. Clear it with schedule_cron = "" only when requested; preserve an existing schedule during unrelated edits.For answer, review, or planning requests, do not create or schedule a Flight. For create or update requests, complete the requested in-scope deployment and on-demand validation; attaching a recurring schedule is authorized only when the request includes scheduling.
Read only the reference sections needed for the current task.
references/FLIGHTS_GUIDE.md for the full concept and operations reference: anatomy, runtime environment, config vs secrets, scheduling, versioning, run lifecycle, the complete MCP tool reference, MCP-vs-SQL naming, loading strategies by data volume, and troubleshooting.references/FLIGHT_EXAMPLES.md for three complete, best-practice flight templates (dlt ingestion, Postgres ingestion, scheduled S3 partition refresh) with their requirements.txt, secret setup, and deploy calls.Load related skills only for missing capabilities; reuse established context.
motherduck-load-data for choosing the ingestion SQL the flight will run (CTAS, INSERT ... SELECT, cloud-storage secrets)motherduck-query for validating the DuckDB SQL inside the flight before deploying itmotherduck-explore for confirming target databases, schemas, and tables existmotherduck-build-data-pipeline when the work is a full raw/staging/analytics pipeline design and the flight is just its schedulermotherduck-cli when the agent has a shell and should keep Flight source in local filesmotherduck-manage-guides for reusable personal or organization Flight conventions