> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcprouter.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute one intent

> Scope eligible tools before model proposal, validation and governed dispatch.

# Execute one intent

> **Public documentation preview — incomplete.** The SDK and optional AI SDK peers remain private and unpublished. This illustrative flow is not a tested live-provider or production authorization recipe.

After [configuring models, servers and policy](/integrate/models-servers-policies), `router.execute` accepts a prompt, trusted context and selected sources. It performs **at most one** governed tool call. It is not an autonomous planner, transaction or general multi-tool loop.

```ts theme={null}
const context = await getAuthenticatedContext();
if (context.role !== 'reader' ||
    typeof context.customerId !== 'string' || !context.customerId) {
  throw new Error('Authenticated reader and customer ID required');
}

const router = createAppRouter();
try {
  const result = await router.execute({
    prompt: `Get the balance for customer ${context.customerId}.`,
    tools: mcpServers.filter(server => server.serverId === 'billing-server'),
    context,
    signal: AbortSignal.timeout(30_000),
  });
  console.log({ status: result.status, sideEffectState: result.sideEffectState });
} finally {
  await router.close();
}
```

This **integration fragment** refers to your host-supplied `getAuthenticatedContext`, and to `createAppRouter`/`mcpServers` from the [configuration guide](/integrate/models-servers-policies). The source-controlled `examples/code.ts` module is a structural reference for repository maintainers, not proof of a live provider result.

Within this scope the policy makes only `get_customer_balance` eligible and its exact binding selects `billing.routing`. The model may propose tool arguments; the router validates them and checks the authenticated customer ID again before dispatch. Host policy must enforce tenant/resource restrictions for your application.

Passing the mixed-model server array without narrowing can yield `needs_input` **before** ranking or model inference; `limit: 1` cannot choose a specialist. Model-access restrictions may instead produce `model_access_denied` first. An explicit allowed `model` override is possible but must pass access checks. Inspect the returned `status` and `sideEffectState`: denial, approval, missing input, stale binding, timeout, and unknown post-dispatch effects are not success. Do not automatically retry unknown effects or bypass approval.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.