Framework-native tools - AWS Prescriptive Guidance

Framework-native tools

Although the Model Context Protocol (MCP) provides the most flexible foundation, framework-native tools offer advantages for specific use cases.

The Strands Agents SDK offers Python-based tools characterized by their lightweight design that requires minimal overhead for simple operations. They enable quick implementation and allow developers to create tools with just a few lines of code. In addition, they're tightly integrated to work seamlessly within the Strands Agents framework.

The following example demonstrates how to create a simple weather tool using Strands Agents. Developers can quickly transform Python functions into agent-accessible tools with minimal code overhead and automatically generate appropriate documentation from the function's docstring.

#Example of a simple Strands native tool

@tool

def weather(location: str) -> str:

"""Get the current weather for a location""" #

Implementation here

return f"The weather in {location} is sunny."

For rapid prototyping or simple use cases, framework-native tools can accelerate development. However, for production systems, MCP tools provide better interoperability and future flexibility than framework-native tools.

The following table provides an overview of other framework-specific tools.

Framework

Tool type

Advantages

Considerations

AutoGen

Function definitions

Strong multi-agent support

Microsoft ecosystem

LangChain

Python classes

Large ecosystem of pre-built tools

Framework lock-in

LlamaIndex

Python functions

Optimized for data operations

Limited to LlamaIndex