Skip to content

Ask which task to follow

MCPCLIIntermediate~10 min

Describe what is happening in a sentence, and the Agent hands back the one task it should follow, with the full instructions, or tells you that no task fits. Nothing is recorded. On MCP nothing needs installing: you get it by asking your agent. The CLI does the same for you at a terminal, further down.

This answers "what do I do now?". To see everything an Agent can do, use See an Agent's tasks and processes instead.

Sources, and what was run

Read from the shipped tool text of hadron_get_instructions on the production server, from hadron-server pull request #5347 at a5f79802, and from hadron agent instructions and hadron agent tasks list --phrase as built from hadron-cli pull request #3287 at 2df61278. That CLI is merged but not in a tagged release yet: the latest release when this was written, v0.62.0, does not have it. Every example output below was produced by running that build against the production server on 2026-11-28. The specs behind this, cor:dmo:050:24 and cor:dmo:050:15, are Proposed, so nothing here is law yet. Only their Decided parts are ruled: the tool and flag names, the vector ranking and the 0.45 default.

Ask your agent

I was handed a pull request to review and I'm not sure how to start.
What task should I follow?

Your agent calls hadron_get_instructions with that sentence as the phrase. A bound worker does not need to say who it is: it is answered as its own Agent. A person or an App key has no Agent of its own and must name one. You can also name an Agent:

Using hrn:agent:acme.com:support-bot, what should I do when the nightly job fails?

Two things can come back.

A match. The best task, with its whole body, so the agent can follow it. Up to two runners-up are named underneath without their bodies. They are not instructions; they are there so you can see what else was close.

No match. No body at all. You get the nearest tasks, each marked as not instructions, and, when you asked inside an App, the fallback task that App names for instructions.no-match. A "no task fits" is a normal answer, not an error: it means nothing the Agent knows about fits the sentence well enough.

Say it so a task can be found

Only each task's abstract is matched. The body is never searched. A task with no abstract is never found, however well its body fits, and a task whose abstract does not say when it applies will lose to one that does. If you write tasks, write the abstract as the situation: "Run this when a worker's model is wrong for the work", not "Model switching".

If you want a specific event instead

An App can map an event code (a wake, a failed build) to a task in its action register. Give the event code and the App, and the register answers first; if it maps the event to a task, that task is the match. If it does not, your phrase, if you gave one, is matched as above. An event code needs an App, because the register is read only in an App, and so does the fallback task.

What can go wrong

What you see What it means
BAD_USER_INPUT: "agentRef is required when the caller has no Agent of its own" You are a person or an App key, with no Agent of your own, and you named none. Name one.
BAD_USER_INPUT: "eventCode needs appRef" An event code with no App. Give the App.
AGENT_NOT_FOUND The Agent does not exist, or you cannot read it: the two answer alike. With an App, the Agent must also be installed or cast there.
APP_NOT_FOUND The App was not found.
"No task fits" Not an error. Reword the phrase, or check the task's abstract.

The first two and AGENT_NOT_FOUND were produced against the production server. APP_NOT_FOUND is from the tool's own text and was not triggered.

Do it at a terminal

You will need the CLI for this part, and a build that has agent instructions (see the note at the top). Give a phrase, an event code, or both:

hadron agent instructions "switch a worker to a different model" \
  --agent hrn:agent:hadronmemory.com:agent-team

A match prints the task's name, URN, route and score, then its body:

Task:   Switch a worker's model [Orca]
URN:    hrn:node:hadronmemory.com:agent-team-system:tasks:switch-worker-model
Route:  SEARCH
Score:  0.70

# Switch a worker's model [Orca]
...

Route is SEARCH when the phrase decided it and REGISTER when an event code did. No match looks like this (from hadron agent instructions "I need to review a pull request" --agent hrn:agent:hadronmemory.com:agent-team):

No task fits.

Nearest tasks (not instructions):
NAME                              URN                                          SCORE  MATCHED BY
Switch a worker's account [Orca]  hrn:node:...:tasks:switch-worker-account     0.19   VECTOR
  • --agent names the Agent. A bound worker may leave it out and the server uses the worker's own Agent; the CLI never looks one up. A caller with no Agent of its own gets the server's refusal.
  • App. The call has no App unless one is called for. --app sends it. With --event-code the configured App is sent too, because the register needs one. A phrase-only call never sends the configured App: an App-scoped call is refused when the Agent is not installed there, where an App-less one answers.
  • --json prints the whole answer: state (MATCHED or not), route, instructions, candidates with their score and matchedBy, nearest, fallback and register.
  • Nothing is kept. The CLI writes no history, log or cache of your phrase.

Exact flags are in the CLI reference.

To see the ranking, not the answer

hadron_agent_tasks and hadron agent tasks list take the same kind of phrase and return the best-fitting tasks, ranked, without bodies. Use them to see why a task did or did not win. Each result carries a score and matchedBy; limit is 3 by default and at most 10. See the MCP tools reference.