Agent Context Protocol Upgrade: On-Demand Skill Loading and Async Tasks in Practice

    This article breaks down the Model Context Protocol (MCP) upgrade that turns tools into on-demand skills and adds asynchronous tasks, in-execution authorization, and direct file uploads. It explains the three bottlenecks behind the change—context bloat, synchronous blocking, and missing human confirmation—then walks through each capability with sample declarations and code, plus engineering checklists for idempotency, state machines, result lifecycle, least privilege, and observability. Readers will find a four-step adoption path for building auditable, production-grade agent pipelines.

    1. Background: Three Bottlenecks in Agent Adoption

    Over the past two years, the Model Context Protocol (MCP) has become a common standard for connecting agents to external systems. It abstracts how a model discovers capabilities, invokes them, and receives results into a standard interface, so a single agent can connect to many heterogeneous backends. As the number of connections grows, however, three engineering problems surface.

    The first is context bloat. Every connection injects tool names, descriptions, and parameter structures into the context. With many connections, the window available for actual business reasoning gets squeezed. The common industry approach is deferred injection and on-demand retrieval. The official reference figure is that, under concurrent multi-server scenarios, loading tool definitions on demand can compress this overhead by more than 80%.

    The second is synchronous blocking. Traditional invocation follows a request–wait–return model, so a single long-running operation stalls the entire conversation flow and the agent cannot advance other subtasks in parallel.

    The third is the lack of human confirmation points. For destructive operations such as billing, deletion, or overwriting, agents often run straight through, with no auditable pause or authorization step.

    2. Capability 1: On-Demand Skill Loading

    The new specification extends “tools” into “skills.” A skill is a structured package that, beyond executable actions, includes domain knowledge, best practices, and multi-step workflow guidance. It can also deliver differentiated instructions scoped by user or organization. At runtime, not all content is injected up front; a lightweight index loads first, and the full body is fetched only after a match.

    An illustrative skill declaration (pseudocode, structure only):

    1. {
    2. "name": "storefront-redesign",
    3. "description": "Online store redesign workflow and standards",
    4. "when_to_use": "User asks to change page structure or visual style",
    5. "steps": ["Audit current state", "Propose a plan", "Canary release", "Regression validation"],
    6. "tools": ["read_layout", "apply_theme"]
    7. }

    Three engineering points matter. First, the description must state clearly “when to use”; retrieval quality depends on trigger conditions, not keyword stuffing. Second, skill granularity should be moderate: too coarse reintroduces context pressure, too fine adds scheduling overhead. Third, establish versioning and canary mechanisms; because a skill carries executable behavior, it must be reviewed and rolled back like code.

    3. Capability 2: Asynchronous Tasks and Background Execution

    Asynchronous tasks move long-running operations out of the conversation path. The agent submits a task, immediately gets back a handle, and continues with other work, later retrieving the result or status via that handle. This naturally fits long-polling batch jobs, builds, data processing, and multi-agent orchestration.

    1. handle = submit_task(server="data-warehouse", payload=job)
    2. # Other subtasks can be processed in parallel meanwhile
    3. status = poll(handle) # queued / running / succeeded / failed
    4. result = fetch_result(handle)

    Three things must be in place: idempotency keys and retry policies to avoid side effects from duplicate submissions; a state machine with timeout termination to prevent zombie tasks from consuming resources; and result lifecycle management that defines retention and expiry cleanup, storing large results in object storage and returning only a reference when necessary.

    4. Capability 3: In-Execution Interaction and Authorization

    Interactive elicitation lets a server pause mid-execution, collect input and authorization from the user through a form or link, and then resume from the breakpoint. Typical cases include confirming a budget before creating paid resources, a second confirmation before running a destructive statement, and requiring the repository name before deleting a code repository to align intent.

    For security design, follow least privilege and explicit consent: declare sensitive actions separately and disable them by default; bind confirmation credentials to the task handle with time-limited, single-use properties; write the entire process to a logging service and connect it to monitoring and alerting to form an auditable chain. Note that human confirmation is a compensating control and cannot replace server-side validation; input must be constrained by whitelists and type checks.

    5. Capability 4: Direct File Upload and Data Boundaries

    Direct file upload hands documents, spreadsheets, and images straight to the backend for processing without passing through the model context first. This saves window space and shrinks the exposure surface for sensitive data. In practice, agree on size and type limits, transmission encryption, isolated backend storage with expiry deletion, and state the data usage and retention policy clearly in the prompt.

    6. Adoption Recommendations and Usability

    A four-step path is recommended: first, inventory capabilities and trigger conditions; then implement index-based loading and caching; next, introduce the task state machine and confirmation points; finally, complete observability and permission governance. For teams building on general cloud capabilities, a container platform can host servers, a message queue can distribute tasks, object storage can hold artifacts, and logging and monitoring systems can provide auditing.

    This specification is an open specification and its extensions, not something exclusive to a single client, and compatible clients can reuse it as well. For teams that want to stand up such a pipeline quickly, Baidu AI Cloud can provide support across general categories such as model services, containers, and observability. Overall, on-demand loading solves “cannot fit,” asynchronous tasks solve “cannot wait,” and interactive confirmation solves “cannot let go”—only the three combined are key to agent engineering.