Skip to content

[FEATURE] Initial support for task-augmented MCP tools #356

@LucaButBoring

Description

@LucaButBoring

Problem Statement

I would like to be able to use Strands to interact with MCP servers exposing task-augmented tools.

Proposed Solution

For a minimum implementation, I should be able to have the agent simply block on the result of the task, making it indistinguishable from any other tool from an integration standpoint. A more sophisticated implementation should leverage task statuses for messaging and could implement proper concurrency, but I consider that out of scope for a P0.

This only requires calling this._client.experimental.tasks.callToolStream() instead of this._client.callTool() here. callToolStream() supports both task and non-task tools. There's room for discussion around whether this should just be replaced or if it should be under some sort of flag for now.

Use Case

This basic level of integration would just unblock usage of task-augmented tools in general. Practically speaking, that happens to enable using tools that take an extended amount of time to run without holding e.g. an HTTP connection open for the full duration of the tool call.

The aforementioned more sophisticated implementations would give developers confidence that a tool is continuing to execute via active status polling, and would also enable agents to multitask (again out of scope for P0, but this is a building block towards those more advanced use cases).

Alternatives Solutions

No response

Additional Context

I have a demo server to test against here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions