Home/Blog/Managing tool discovery and per-call identity in stateless model platforms
Managing tool discovery and per-call identity in stateless model platforms
October 11, 2026

Managing tool discovery and per-call identity in stateless model platforms requires a change in where orchestration state lives. With stateless MCP, a request cannot depend on a handshake-created server session being present, so capability selection, authentication context, and workflow continuity must be carried through explicit request data, credentials, and handles.
This is not simply a transport-level implementation detail. It affects load balancing, account selection, tool contracts, retry behavior, privacy controls, and the way agent platforms hand work from one specialist to another. The practical objective is to make any valid request executable by any suitable server instance while preserving the identity and context needed to perform that specific operation correctly.
Stateless MCP: the direct architectural answer
Direct answer:
In a stateless model platform, discover tools when they are needed, attach verified identity and capabilities to each call, and represent cross-call workflow state with explicit handles or returned context rather than hidden server sessions. This allows requests to be routed independently while keeping identity, authorization, and continuation deliberate and auditable.
The MCP 2026-07-28 specification formalizes this approach. It retires the initialize/initialized exchange and the Mcp-Session-Id er. Instead, every request carries its own protocol version, client identity, and client capabilities in _meta.
That shift removes an assumption common in earlier integrations: that a client first establishes a logical conversation with a particular server-side session, then relies on that session to inform later requests. A stateful exchange can be convenient during development, but it creates an operational dependency on session affinity or shared session storage. In a distributed environment, either dependency becomes a design choice with costs.
Per-call metadata makes the request self-describing enough for execution. A server instance receiving the request can determine the relevant protocol details and client context from the request itself, rather than recovering them from local memory. According to the updated MCP model, this enables a request to land on any server instance behind a round-robin load balancer without shared session storage.
What moves out of the session
Protocol and client information:
Each call carries the protocol version, client identity, and client capabilities in
_meta
.
Routing information:
Streamable HTTP requests include
Mcp-Method
and
Mcp-Name
, enabling routing and dispatch without a prior handshake.
Authentication context:
A server can verify a token, extract user identity, and create a per-request server instance with the resulting auth context.
Workflow continuity:
State that must survive a call boundary is represented explicitly, such as a handle returned by a tool and provided again as an argument.
This does not mean that systems have no state. It means state is no longer silently owned by an unspecified server session. Durable business systems still have records, jobs, files, authorization policies, and external side effects. The design discipline is to distinguish those durable resources from transient, hidden in-memory connection state.
Use runtime tool discovery without making every call expensive
Tool discovery should answer a focused question: what can this server or connected integration do at the moment the agent needs to act? In the updated MCP specification, server/discover lets a client learn a server’s versions, capabilities, and identity before making another request. Discovery is optional, which matters because not every call needs a fresh inventory step.
The separation between discovery and execution is useful for agent orchestration. An agent can first determine whether a specialist service exposes the needed capability, then dispatch only the relevant tool call. It no longer needs to treat an initial session handshake as the sole place where capabilities are learned.
Choose the discovery strategy by decision risk
Preloading a complete manifest remains understandable when the tool surface is small, stable, and known to be relevant to every task. The cost is context consumption and unnecessary coupling: an agent receives tools it may never use, and a workflow may carry a large capability set before it has determined which domain is involved.
On-demand discovery is better suited to broad, changing, or specialist tool ecosystems. Anthropic’s advanced tool-use materials describe marking tools for on-demand discovery, reinforcing runtime selection as a practical pattern. The goal is not to hide capabilities arbitrarily; it is to reveal enough information to make the next safe decision.
Start with the user objective and the orchestration policy, such as whether the task concerns support, finance, operations, or an engineering system.
Identify the appropriate server or specialist agent based on that objective.
Use discovery where the capability set, version, or server identity is unknown or could change.
Inspect the returned versions, capabilities, and identity before selecting an execution path.
Invoke only the tool required for the next action, passing identity and authorization context with that call.
The main trade-off is additional interaction before execution. Optional discovery means a platform can avoid it when the server contract is already known, while retaining the ability to discover at runtime when a route is dynamic or the available tooling is large. Treat discovery as a policy-controlled operation, not an unconditional preamble.
Header-based routing supports this model. The Mcp-Method and Mcp-Name ers on streamable HTTP requests let infrastructure route a request to the relevant endpoint or dispatcher without relying on a prior negotiated session. For a control plane that routes work among specialist MCP-connected agents, this creates a cleaner boundary: routing can examine request-level intent, while the target service evaluates the call and its attached context.
Design per-call identity around stable authenticated profiles
Per-call identity should be stable for the person or principal being represented, but freshly verified and bound to the request that is being executed. Those ideas work together. Stability allows systems to recognize the same authenticated profile over time; per-call verification prevents a platform from trusting an old, implicit server-session association.
OpenAI’s Plugins authentication guidance explicitly advises against generating a new ID for every login, token, session, or tool call. Its recommended direction is an authenticated profile tool that returns an opaque, stable identity. That is a significant distinction: a credential, a session, and a profile identifier have different lifecycles and should not be substituted for one another.
Separate the identity layers
Authenticated credential:
The material used to establish that a request is authorized. It must be verified before identity is trusted.
Stable profile identity:
An opaque identifier representing the authenticated profile across appropriate interactions. It should not be regenerated per tool call.
Per-call auth context:
The authorization-relevant context constructed after token verification for the request being served.
Selected account:
The connected account chosen for a particular operation when a user has more than one available account.
OpenAI documents runtime discovery of a designated authenticated profile tool: it discovers the tool, calls it with the connection’s credentials, and validates the response before using the profile data. This pattern makes identity acquisition an explicit, authenticated operation rather than an assumption imported from a local browser session or a prior tool call.
For MCP Apps authentication, the per-request model is equally direct. Servers can extract a user identity from a verified token and create a per-request server instance carrying that auth context. The server instance is therefore configured for the call it is handling, rather than relying on an earlier request to populate identity data that later calls may inherit accidentally.
A stable ID does not grant broad authorization by itself. It is an identity reference. The receiving service still needs to evaluate the verified credential and the permissions relevant to the requested operation. This distinction helps prevent a familiar implementation error: treating a persistent identifier as if it were proof that a current call is authorized.
Route multi-account tool calls with request-scoped credentials
Multi-account behavior becomes clearer when account selection is made at invocation time. OpenAI states that all connected accounts are available to the model, which selects the relevant account or accounts when invoking tools based on the user’s request. That design avoids binding a whole conversation or server session to one account when the task itself determines which account is applicable.
For example, a user may ask an operations agent to retrieve information from one connected workspace and then carry out an unrelated action in another. The platform should preserve the user’s instruction, select the applicable account for each tool invocation, and ensure the target tool receives authenticated credentials for that account. It should not infer that the account used by an earlier tool call remains the right one.
Make account choice visible in the tool contract
A practical tool contract distinguishes user-level identity from account-level scope. The authenticated profile can establish who is making the request, while the invocation context and credentials establish which connected account can perform the operation. Where a tool needs an account reference as an argument, the contract should make that reference explicit instead of relying on an undocumented default stored in process memory.
This is particularly important in agent handoffs. A planner may decide that a specialist agent should use a certain integration, but the specialist should receive only the context necessary to select and invoke the permitted account. The handoff should not require access to an unbounded session object containing stale credentials, prior account choices, or unrelated user history.
Keep the user or profile identity stable across appropriate calls.
Verify credentials for the current request before constructing auth context.
Select an account based on the specific requested operation.
Pass the relevant account scope through the invocation path rather than an implicit session default.
Record the decision boundary in operational logs without confusing that record with authorization itself.
The limit is intentional: request-scoped execution does not eliminate the need for careful authorization design. It makes authorization inputs explicit, but each downstream system still owns the decision about what the verified principal can do within the selected account. Stateless transport improves portability and isolation; it does not replace access-control policy.
Replace hidden sessions with explicit state handles and input requests
The hardest part of moving to stateless orchestration is usually not identity. It is continuation. Teams often place partially completed work, form state, approval context, pagination cursors, or temporary selections in server memory because it is convenient. That approach breaks down when a later request reaches a different instance or arrives after the original process is gone.
MCP guidance provides a concrete alternative: if a server must carry state across calls, it should mint an explicit handle from a tool and require the model to pass that handle back as an argument. The handle makes the dependency part of the tool contract. A later call can be independently routed while still referring to the required workflow resource.
Use handles for resource continuity, not an invisible session substitute
A handle should identify the stateful resource or operation that the server is prepared to resume. The server can validate the handle, evaluate the current caller’s authorization, and continue from durable or otherwise retrievable state. The important property is not the spelling of the identifier; it is that the caller provides it explicitly and the server does not assume a process-local session is available.
Do not treat a handle as permission by default. A correct implementation still checks whether the authenticated identity on the new request is allowed to access or resume the referenced resource. That is especially important after an agent handoff, a retry, or a change in selected account.
Use MRTR when the server needs more input
Multi-round-trip work does not require reinstating a session. MCP’s MRTR flow allows a server to return resultType: "input_required". The client can then retry the original call with inputResponses, preserving a stateless transport while allowing an interaction to collect missing information.
The client makes the original tool call with the available arguments and per-call metadata.
The server determines that required input is missing and returns
resultType: "input_required"
.
The client collects or derives the requested response in the appropriate interaction layer.
The client retries the original call, including
inputResponses
and the current request’s identity and authorization context.
The receiving server instance validates the request and continues the operation without needing a prior local session.
This is a useful distinction for platform engineers: interactive does not mean stateful at the transport layer. A process can be multi-step while each message remains independently processable. The client, explicit arguments, durable handles, and returned input requirements provide continuity that a hidden session once supplied.
Build execution for load balancing, retries, and isolated runtimes
The operational advantage of per-call context is straightforward: independent requests can be distributed without assuming server affinity. In the MCP 2026-07-28 model, each request contains the information needed for protocol handling and client identification, allowing calls to land on any server instance behind a round-robin load balancer without shared session storage.
That property is valuable only if application behavior is designed accordingly. A tool implementation that saves critical state only in local memory is still effectively stateful, even if the protocol no longer uses Mcp-Session-Id. Stateless MCP requires the execution layer to put resumable resources where another eligible instance can validate and retrieve them, or to return explicit continuation data to the caller.
Learn from isolated program execution
OpenAI’s Programmatic Tool Calling documentation describes generated programs running in a fresh V8 runtime for each execution, with no persistent JavaScript state between executions. This is a practical model for orchestration teams: assume a later action starts in a clean runtime. If the action needs inputs from earlier work, provide them explicitly.
Fresh runtimes encourage disciplined boundaries between planning and execution. They reduce the temptation to use ambient variables from a prior invocation, but they require a reliable context-passing design. An orchestrator must pass the task objective, validated tool outputs that remain relevant, selected account scope, and any explicit continuation handles to the next execution step.
Test failure modes, not only happy paths
Send a follow-up call to a different server instance and confirm it succeeds with only explicit request data and allowed
durable state
.
Retry a tool call after an interruption and verify that duplicate or resumed work follows the tool’s designed semantics.
Run an MRTR sequence with the retry handled by another instance.
Switch between connected accounts across calls and verify that the intended authenticated credentials are used for each invocation.
Invalidate or reject an unsuitable handle and confirm the tool does not accept it merely because it was valid in an earlier context.
Anthropic’s 2026 State of AI material describes a familiar systems trade-off: traditional stateless systems scale well but lose context when disrupted. It also describes infrastructure designed for resumability, redelivery, and context preservation across platforms. The implication for agent workflows is not to restore opaque session state. It is to design explicit mechanisms for preserving the context that must survive disruption.
Separate stateless continuation from retention and privacy promises
Stateless continuation and data retention are related operational concerns, but they are not the same guarantee. OpenAI notes that store: false enables stateless continuation, yet does not by itself enable zero data retention (ZDR). ZDR must be enabled separately.
This distinction matters when explaining an architecture to security, privacy, and compliance stakeholders. A system may avoid server-side session state and still retain data elsewhere under its applicable policies. Conversely, a retention configuration does not automatically make tools safe to route without explicit identity, authorization, and continuation design.
Document the boundaries precisely
Describe statelessness in terms of request processing: the server does not require a prior transport session to understand the current protocol context, client identity metadata, and capabilities. Describe persistence in terms of the resources that must survive: explicit handles, application records, job state, and any context the client resubmits. Describe retention as its own policy and control area.
This language is more accurate than saying a platform is simply “stateless” or “private.” It gives reviewers concrete questions to evaluate: What travels on each call? What is stored durably? What identifiers remain stable? What must be verified again? What retention setting applies? Clear answers build trust because they avoid implying guarantees that the chosen transport mode does not provide.
Adopt stateless orchestration without breaking older session-dependent services
Migration should begin with an inventory, not a blanket switch. Older MCP guidance treated Mcp-Session-Id as the mechanism that associated multiple requests with a logical session and described Stateless = false as appropriate when a server depended on session features. The updated SDK guidance now says stateful-only properties have no effect when a request is served without a session, including every 2026-07-28 request or a server configured for stateless mode.
That means teams need to find assumptions embedded below the protocol surface. Look for cached client capabilities, user identity set during initialization, in-memory workflow objects, selected-account defaults, and UI input flows that expect a particular server process to receive the next message. Each assumption needs an explicit replacement or a deliberate decision to keep a stateful service where that is still required.
A pragmatic migration sequence
Map hidden dependencies.
Identify all values currently read from session state or local process memory during tool execution.
Classify each value.
Decide whether it belongs in per-call metadata, verified auth context, explicit tool arguments, an opaque handle, or durable application storage.
Add request-level identity handling.
Verify tokens on the request and construct the per-request context needed by the tool.
Introduce discovery selectively.
Use
server/discover
when dynamic capability resolution is useful; do not require it before every known, stable operation.
Convert multi-step interactions.
Use explicit handles and MRTR
input_required
responses rather than relying on an established connection session.
Validate across instances.
Exercise the workflow with load-balanced routing, restarts, retries, and account changes.
Retire obsolete assumptions.
Remove behavior tied only to initialization or session-only properties once the explicit contract is proven.
The official MCP registry and plan matrix now reference the 2026-07-28 discovery path and list SEP-2575, “Make MCP Stateless,” in the protocol roadmap. Ecosystem direction therefore supports planning for request-level discovery and execution, even if an organization must operate a mixed estate during migration.
The durable design principle is simple: make the next call understandable on its own. Discover capabilities when the route is uncertain, use stable authenticated profiles rather than disposable identifiers, bind authorization to the request, and pass only explicit state that the next tool needs. This makes specialist-agent handoffs and tool-backed workflows easier to scale, inspect, and recover.
For platform teams, the next useful step is to audit one end-to-end agent workflow for hidden session dependencies. Replace one implicit dependency at a time with request metadata, verified per-call auth context, a selected account scope, or an explicit handle; then test that the same workflow works when every call is routed to a different eligible instance.