Plane docs
Guides

Deferred tools

Past a dozen tools, listing them all costs tokens before any work happens.

Every tool's schema goes into every request of every step. Past a dozen or so, that costs real money before the model has done anything, and it makes the model's choice worse rather than better.

So say which tools matter and let Plane hide the rest behind discovery.

export default definePlane({
  agent: {
    slug: "support-bot",
    model: { provider: "gateway", model: "anthropic/claude-sonnet-4.6" },
    system: "…",
    // eager | deferred | auto. `auto` is the default and defers only once the
    // resolved catalogue passes `autoThreshold`, so a small agent pays nothing.
    toolLoading: { mode: "auto", autoThreshold: 12 }
  },
  tools: [
    tool({
      name: "lookup_order",
      description: "Where an order is right now, by order id",
      deferLoading: false,               // the one it reaches for constantly: pin it
      input: z.object({ orderId: z.string() }),
      handler: lookupOrder
    }),
    tool({ name: "get_size_guide", description: "…", handler: sizeGuide })  // discoverable
  ]
})

Everything not pinned becomes reachable through three tools Plane presents instead — one that searches the catalogue, one that describes what it found, and one that runs a small program calling them. Each of those inner calls is still a real, logged, signed, gated call to your handler; only the presentation differs. You write your tools exactly as before.

Descriptions become the search index

Discovery matches on the description and the rendered signature. So

"Where a parcel is right now, by tracking number"

is found and

"Track shipment tool"

is not. This is the one place where writing a good description has a measurable effect on whether the tool ever gets used.

In the transcript

A call dispatched from inside a plan carries parentToolCallId, and the control plane's transcript nests it inside the plan's card. The three plan tools render as what they are — a query and its hits, some names and their schemas, a script and its steps — rather than as JSON.

What it costs

Nothing, until the catalogue is big. And one thing it must never do: a discovery search does not materialise a tool into the model's array mid-session. Doing so would rewrite the cached prefix, which is a 12.5× multiplier on it — and would spend most of what deferred loading saves. See context and caching.

On this page