Agents, MCP and skillsLoading progress…

Roles and contracts

Choose when to delegate independent work and define handoffs, shared-state rules and evaluation.

Roles and contracts

Give each worker a concrete task, the resources it may use and the deliverable expected. The contract is also its whole authority: a worker can never hold more permission than the caller who delegated to it, so the allowed list is the overlap of what it asks for and what the caller has. Authority flows down the chain, never up.

The caller (orchestrator) holds: read, search. Choose what the worker asks for.

contract { task: "summarise the three reports" allowed: [read] deliverable: "a 5-line summary" } refused (caller does not hold them): write the worker can act only inside its contract; delegation never broadens the caller's authority

Give each worker a concrete task, allowed resources and a deliverable. A missing deliverable or an over-broad permission list is a contract problem to catch before work starts.

Ask for permissions the caller does not have.

Predict first. Can a worker authorize an external write that the original task never allowed?

Chapter context

Delegation can divide a task into focused work units, but coordination creates costs and new failure paths. Add helpers when their independent contributions can be integrated and checked more clearly than one agent can do the work alone.

Chapter reference: math, worked example & code

This section belongs to the whole chapter, so it is the same on every lesson in it and may cover a different lesson's topic. The code for the experiment you just ran is inside the experiment itself.

Math and notation

With independent parallel task durations t1,…,tnt_1,\ldots,t_n and merge time m, an ideal lower-bound schedule is max⁡iti+m\max_i t_i+m, excluding orchestration overhead. If independent tasks each succeed with probability p, all n succeed with probability pnp^n; correlated failures invalidate that simple model.

Worked example

Three tasks take 2,5 and 3 minutes; integration takes 1. Ideal sequential duration is 11 minutes, while fully independent parallel duration is 6. Separately, three independent 90%-reliable components all succeed with probability 0.9^3=0.729. The latency gain does not itself establish a reliability gain.

Reference code

The following example uses the Python standard library and does not call a remote service.

from math import isclose
times,merge=[2,5,3],1
assert sum(times)+merge == 11
assert max(times)+merge == 6
assert isclose(.9**3,.729)

Python examples are provided for study and local execution; this page does not execute Python.

Common mistakes

Parallel workers need explicit ownership of shared artifacts. Agreement can reflect correlated failure. More agents can increase token usage and integration work even when wall-clock time falls.