Capability Routing

Pick the tool by what it can do, not what it's called.

A request is matched to the tool, agent, or service whose declared capability fits it — selection by capability metadata rather than a hardcoded condition — and a missing capability is detected explicitly instead of silently mis-routed.

In practiceA customer-service orchestrator routes a 'track my parcel' request to the logistics tool and a 'process refund' request to the payments tool, selected by a capability tag rather than a hardcoded condition.

Level
04 · Production
Subdomain
Tool Integration
Also known as
Tool Selection, Capability Matching, Skill Routing
Trade-off
Flexible selection is gained against the risk of misallocation and policy complexity.
Native in
LangGraph, OpenAI Agents SDK, Microsoft Agent Framework, Google ADK, AWS Strands
The mechanism

How it works.

Each tool or agent declares what it can do. A request is matched against those declarations, and a request nobody can serve is reported instead of being sent somewhere anyway.

1 · Declare

  1. List the capabilitiesTags or a description per tool
  2. Attach the policiesWho may use it, and for what

2 · Route

  1. Derive the needWhich capability does this request ask for?
  2. MatchAgainst the declared capabilities
  3. Check the policyIs this caller allowed?
  4. Dispatch or reportTo the match, or “no capability”
Capability
A named thing a tool can do, declared by the tool and not guessed by the router.
Policy
A rule on top of the match: this caller may use this capability, that one may not.
Fallback
What happens when nothing matches: say so, ask back, or hand over to a person. Never the nearest tool.
Walk it through

A real run, step by step.

TaskA customer-service orchestrator with three tools: logistics, payments and orders. Four requests arrive:
Illustrative run.
RequestNeededMatchOutcome
“Where is my parcel?”Shipment trackingLogistics toolDispatched
“Refund order 7731.”Refund processingPayments toolDispatched
“Correct the VAT rate on my invoice.”Tax correctionNoneReported: no capability, handed to a person
“Cancel my order and refund it.”Cancellation, then refundOrders tool, then payments toolDispatched in sequence
What this shows: the third row is the point. A router built from if and else would have sent the VAT request to payments, because payments is the nearest thing. Here the gap is detected and named. A new tool needs only a new declaration. The risk moves into the declarations: two tools that claim the same capability, or one that claims too much.
In code

The pattern in code.

Plain Pythonpython
CAPABILITIES = {
    "logistics_tool": {"shipment_tracking", "address_change"},
    "payments_tool": {"refund_processing", "payment_status"},
    "orders_tool": {"order_cancellation", "order_lookup"},
}

def route(request, caller):
    plan = []
    # e.g. ["refund_processing"]
    for capability in extract_capabilities(request):
        tools = [tool for tool, declared in CAPABILITIES.items()
                 if capability in declared and allowed(caller, tool)]
        if not tools:
            # explicit, never the nearest tool
            return escalate(request, missing=capability)
        plan.append(tools[0])
    return [call(tool, request) for tool in plan]
Fit

Use it, or not.

When to reach for it

  • Many capabilities are available.
  • Selection must follow metadata or policies.
  • Missing capabilities must be explicitly detected.

When it backfires

  • Tool selection is trivial.
  • Capability descriptions are imprecise.
  • Routing cannot be observably tested.
Pitfalls

Two ways this pattern will hurt you.

Two tools claim the same capability

Ambiguous capability tags let two tools match the same request. The router picks non-deterministically; downstream behavior drifts run to run.

Countermeasure

Score by capability specificity and break ties with an explicit priority field. Log the score so the chosen tool is auditable.

No tool fits, so the router picks the nearest anyway

A request outside every tool's capability gets force-matched to the closest one. The agent runs a tool that was never meant for the task and returns a confident wrong result.

Countermeasure

Require a minimum match score and give the router an explicit no-match branch that declines or escalates, rather than always selecting a best-of-bad option.

Framework support

Where Capability Routing is native.

LangGraphconditional routingNative
OpenAI Agents SDKhandoffsNative
Microsoft Agent Frameworkrouting logicNative
Google ADKagent routingNative
AWS Strandscapability routingNative
Sources

Where this pattern comes from.

  1. Gorilla: Large Language Model Connected with Massive APIsIn the source list

Search

Search patterns, frameworks, and pages.