Module tool

Source
Expand description

Tool system for MCP servers

This module provides the abstraction for implementing and managing tools in MCP servers. Tools are functions that can be called by clients to perform specific operations. Enhanced with advanced parameter validation, type checking, and metadata support.

Structs§

AdditionTool
Tool for adding two numbers
CalculatorTool
Enhanced calculator tool with comprehensive validation
EchoTool
Simple echo tool for testing
TextProcessorTool
Text processing tool with advanced string validation
TimestampTool
Tool for getting current timestamp
Tool
A registered tool with its handler, validation, and enhanced metadata
ToolBuilder
Builder for creating tools with fluent API, advanced validation, and enhanced metadata
ValidationChainTool

Traits§

ParameterExt
Extension trait for HashMap to make parameter extraction easier
ToolHandler
Trait for implementing tool handlers
ValidatedToolHandler
Trait for tools that can provide their own parameter validation

Functions§

create_string_tool
Helper function to create a simple string parameter tool
create_typed_tool
Helper function to create a tool with multiple typed parameters