Dynamic Task Router

v0.5.0
io.github.Jacklee504/dynamic-task-router Checked 2 days ago Published 23 hours ago

Routes coding tasks to the cheapest model that handles them safely, using your signed-in CLIs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

dtr_runs

List recent persisted runs for the target repository, newest first. Use it to find a run id for dtr_status, dtr_outcome, or to locate a resumable DTR conversation.

ParameterTypeDescription
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
limitintegerMaximum number of runs to return, newest first. Defaults to 20.

dtr_health

Report which providers (Claude Code, Codex, Antigravity, OpenCode, OpenRouter, Featherless, Ollama) are installed and enabled, and list the configured models with their availability. A quick first check of what DTR can route to; use dtr_doctor to diagnose a provider that is unavailable or failing. Does not invoke a model.

dtr_models

List every configured model with its routing metadata: provider, family, tier, role scores, supported reasoning efforts, whether it is enabled, and whether it is available now. Use it to see why a model can or cannot be chosen, or to find the family and provider names to pass in allowedFamilies, allowedProviders, or a pipeline provider. Contains no credentials and does not invoke a model.

dtr_update_models

Rebuild DTR's generated model layer: upgrade configured model lineages to the newest version the account can use, add new model lines as provisional profiles, disable models a CLI no longer offers, and grade models from recorded outcomes. Probes use a tiny read-only request. Never edits the checked-in registry or personal settings. Returns the changes it made, or would make with dryRun.

ParameterTypeDescription
dryRunbooleanReport the changes without writing them. Models are still probed. Defaults to false.

dtr_discover_models

Discover account-visible OpenCode and Antigravity models plus public models.dev candidates. refresh updates OpenCode's model cache and public metadata. Never edits routing configuration or invokes a model.

ParameterTypeDescription
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
refreshbooleanRefresh OpenCode's model cache and the public models.dev metadata before listing. Defaults to false.

dtr_start

Return DTR's compact dispatch contract for humans or generic MCP clients that lack the installed skill. Installed DTR skills already contain this contract and do not need dtr_start. Does not invoke a model.

dtr_doctor

Run safe, no-inference provider/auth diagnostics before dispatch. Returns only status metadata; never credential values.

ParameterTypeDescription
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.

dtr_usage

Summarize what DTR has run for the target repository, per provider: executions, successes, failures, total duration, and token use and cost where the provider reported them. Use it to see where routed work went and what it cost. It reads only DTR's own run logs; it does not read provider account quotas or billing.

ParameterTypeDescription
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.

dtr_select

Show which model and reasoning effort DTR would choose for a task profile, with the reasons, and why each other model was rejected. Selection is deterministic and nothing runs: no model is invoked and no files are read. Use it to check or explain a routing decision; use dtr_prepare instead to also validate file paths and preview the exact packet a worker would receive.

ParameterTypeDescription
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.

dtr_prepare

Validate one compact task and its relative file paths, then preview the packet, token estimate, and selected route. Does not invoke a model. Optional: normal dispatch validation already happens inside dtr_run, dtr_dispatch, and dtr_pipeline. Use dtr_prepare for route preview, diagnostics, or uncertain scope.

ParameterTypeDescription
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
continueRunIdstringRun ID of a completed dtr_run or dtr_dispatch to follow up on. DTR passes the previous handoff and file list to the new worker. Get it from dtr_status.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
filesarrayUp to 8 repository-relative paths the worker should read first, such as ["src/auth.ts"]. Paths only; DTR never sends file content.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.

dtr_run

Route one bounded, read-only task to the cheapest model that can handle it safely, wait for it, and return the run ID, the routing decision, and the worker's handoff (STATUS, PATHS, CHECK, RISK; at most 1,200 characters). The default way to delegate a task. Pass only the compact objective and up to eight relative file paths; never paste source, logs, transcripts, or reasoning. For long work, use dtr_dispatch to avoid waiting; to compare models, use dtr_fanout; to write code, use dtr_pipeline. Set continueRunId to follow up on a completed run.

ParameterTypeDescription
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
continueRunIdstringRun ID of a completed dtr_run or dtr_dispatch to follow up on. DTR passes the previous handoff and file list to the new worker. Get it from dtr_status.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
filesarrayUp to 8 repository-relative paths the worker should read first, such as ["src/auth.ts"]. Paths only; DTR never sends file content.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.

dtr_dispatch

Start the same kind of bounded, read-only task as dtr_run in the background and return its run ID at once, without waiting for the worker. Use it for long tasks or to keep working meanwhile; poll dtr_status for the result and call dtr_abort to stop the worker. Same compact-task and file constraints as dtr_run. Set continueRunId to follow up on a completed run.

ParameterTypeDescription
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
continueRunIdstringRun ID of a completed dtr_run or dtr_dispatch to follow up on. DTR passes the previous handoff and file list to the new worker. Get it from dtr_status.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
filesarrayUp to 8 repository-relative paths the worker should read first, such as ["src/auth.ts"]. Paths only; DTR never sends file content.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.

dtr_fanout

Run the same bounded, read-only task on 2 to 4 models from independent families (for example Anthropic and OpenAI) at the same time, and return each model's run ID, model, success, and handoff separately. Use it for a second opinion on high-stakes analysis, such as a security review or an unclear root cause; you compare the answers. Costs one run per family, so use dtr_run for ordinary tasks.

ParameterTypeDescription
families *integerHow many independent model families to run the task on, from 2 to 4. Each family is a separate run.
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
continueRunIdstringRun ID of a completed dtr_run or dtr_dispatch to follow up on. DTR passes the previous handoff and file list to the new worker. Get it from dtr_status.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
filesarrayUp to 8 repository-relative paths the worker should read first, such as ["src/auth.ts"]. Paths only; DTR never sends file content.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.

dtr_pipeline

Run a multi-stage workflow in which independent models check each other's work, and return the run ID, final state, and each stage's result. debug-review: two independent debuggers, then a fresh reviewer. plan-challenge-review: an architect's plan, an independent challenge, then a review. implement-review: an implementation, verification, then an independent review; the only template that can change files. Read-only unless write is true. With write: true it edits the current clean checkout in place; set writeMode to "isolated" for a temporary worktree, or "branch" with a branch name for a pers…

ParameterTypeDescription
prompt *stringThe task objective in at most 100 words, stating the outcome wanted. Name files in files instead; never paste source, logs, transcripts, or reasoning.
role *stringThe worker's role. Routing uses each model's score for this role: reviewer for code or security review, debugger for finding a fault, researcher for lookups, architect for design, implementer for code…
template *stringThe workflow to run: debug-review to find a fault, plan-challenge-review to design and stress-test a change, implement-review to make a change and review it.
allowNoopbooleanAccept a write stage that changes no files. By default such a stage fails, since a write task that changes nothing usually went wrong.
allowRemotebooleanSet false to forbid remote providers. Defaults to true.
allowedFamiliesarrayRestrict routing to these model families, such as anthropic, openai, google, or qwen. A hard filter: routing fails rather than relaxing it.
allowedProvidersarrayRestrict routing to these providers. A hard filter: routing fails rather than relaxing it.
branchstringBranch name for writeMode "branch". DTR creates a worktree for it and leaves the changes there for you to review.
complexitystringHow hard the task is. Sets the minimum model tier and reasoning effort: trivial allows the fastest models, extreme requires the strongest. Inferred from the task when omitted.
continueRunIdstringRun ID of a completed dtr_run or dtr_dispatch to follow up on. DTR passes the previous handoff and file list to the new worker. Get it from dtr_status.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
diversitystringHow many independent model families must agree. medium and high need two families, so use dtr_fanout; single routes accept none or low.
filesarrayUp to 8 repository-relative paths the worker should read first, such as ["src/auth.ts"]. Paths only; DTR never sends file content.
implementationProviderstringPin the implementation stage to this provider. Use it instead of allowedProviders, which pipelines do not accept.
localOnlybooleanAllow only local models. Fails rather than falling back to a remote provider.
preferLocalbooleanFavour a local model such as Ollama when one is eligible, without requiring it.
privacySensitivebooleanRequire a local model that does not train on inputs. Use for personal or confidential data.
privateCodebooleanThe task involves private source. Remote models are eligible only if their profile explicitly allows private code.
requiresToolsbooleanRequire a model with tool use on a provider that can read the workspace, so the worker can open files itself rather than only receive the prompt.
reviewProviderstringPin the review stage to this provider, for example a different one from the implementer for an independent review.
riskstringThe cost of a wrong answer. high (security, money, data loss) raises the minimum effort and requires a model scoring at least 8 for the role. Inferred from the task when omitted.
scopearrayRepository-relative paths the implementation may change, such as ["src/router", "tests/router"]. Any change outside them fails the run. Strongly recommended with write.
writebooleanAllow implement-review to change files. Defaults to false, which keeps every stage read-only.
writeModestringWhere writes happen: in-place on the current clean checkout (the default), isolated in a temporary detached worktree, or branch in a persistent worktree on the branch named in branch.

dtr_status

Read the current state of a run: queued, running, succeeded, failed, or aborted, with its routing, timing, and any error. For a completed single route the response includes its DTR handoff and the continueRunId to use for a follow-up. Use it to poll a run started with dtr_dispatch, or to reread an earlier result; dtr_runs lists run IDs.

ParameterTypeDescription
runId *stringA DTR run ID, as returned by dtr_run, dtr_dispatch, dtr_pipeline, or dtr_runs.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.

dtr_abort

Abort an in-flight DTR run started by dtr_run or dtr_dispatch. Idempotent: aborting an unknown or finished run returns accepted: false without an error.

ParameterTypeDescription
runId *stringA DTR run ID, as returned by dtr_run, dtr_dispatch, dtr_pipeline, or dtr_runs.
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.

dtr_outcome

Record your verdict on a completed run after reviewing its result: accepted, partial, rejected, or escalated. DTR uses recorded outcomes to grade each model's role scores, so routing improves over time; a recorded outcome outweighs the signals DTR infers on its own. Call it once per run you reviewed. Stores metadata only, never the task or result text.

ParameterTypeDescription
runId *stringA DTR run ID, as returned by dtr_run, dtr_dispatch, dtr_pipeline, or dtr_runs.
status *stringYour verdict on the result: accepted (used as is), partial (used with corrections), rejected (wrong or unusable), escalated (redone with a stronger model).
cwdstringAbsolute path of the target repository. Defaults to the server's working directory. Never a command.
manualScorenumberYour quality score for the result, from 0 (useless) to 1 (fully correct).
regressionDetectedbooleanWhether the result introduced or missed a regression.
reviewFindingsCountintegerHow many problems your review found in the result.