Overview
What are Tools?
In the Eko framework, Tools are reusable functional modules, just like various tools in a toolbox, each with specific functionality. For example:
- Tools for web search
- Tools for computer use
- Tools for calling APIs
- Tools for reading and writing files
Why Use Tools
1. Modular Design
Tools are independent modules, with each Tool responsible for completing specific functionality. This design allows developers to break down complex workflows into simple, manageable steps. Through this modular approach, developers can reuse these tools across different projects, reduce code duplication, and improve development efficiency.
2. Clear Interface Definition
Each Tool follows a unified interface structure, including name
, description
, input_schema
and execute
methods. This consistency makes it easy for developers to understand and use different Tools without worrying about implementation details of each Tool. For example, aspects involving input data format and execution logic are standardized, reducing learning costs and error probability.
• name: A unique identifier for the tool (e.g. open_url
)
• description: A functional description explaining the tool’s purpose and usage scenarios
• input_schema: A JSON-structured definition of the parameter T
3. Extensibility
In the Eko framework, Tools can be easily extended and replaced. If you find a Tool is not performing ideally in specific use cases, you can design a new Tool to replace the old version without making major modifications to the entire workflow. This flexibility maintains system stability and efficiency under changing requirements.
Role of Tools in Workflow
In the Eko framework, a Workflow is a process of sequential or parallel execution of multiple tasks combined from Tools. The main roles of Tools in Workflow are:
-
Task Division: By dividing large tasks into several smaller Tools, with each Tool responsible for specific functionality, users can better understand the task structure and quickly locate and modify specific steps when necessary.
-
Parameter Management: Each Tool defines its required input parameters (input_schema), ensuring correct data formats are passed during invocation, thus reducing runtime issues caused by parameter errors.
-
Execution Context: Tools can access the ExecutionContext during execution, allowing developers to pass runtime information as needed for intelligent task execution.
-
Task Destruction: For tools that need to clean up resources, Tools also provide an optional
destroy
method, allowing timely release of resources after task completion to maintain system cleanliness and efficiency.
Using in eko
eko framework provides various built-in tools for different environments that can be used directly, and you can also customize tools to complete workflow tasks.
Built-in tools
Here is a demonstration of the node.js environment
Learn more: Available Tools.
Custom tools
Learn more: Custom Tools.
Auto register tools
Automatically register all tools in the current environment.
-
Browser Extension
-
Web
-
Node.js
After registering with Eko.tools = loadTools()
, there’s no need to explicitly register tools in Eko - they can be used directly.
Next Steps
Now that you understand the concept of tools, let’s look at what built-in Tools are available and how to customize Tools:
- Built-in Available Tools of the framework in different environments
- Learn how to Custom Tools
- Learn how to use Tools Hook to dynamically modify input and output parameters