BaseTool

Base class for all tools in the cogency framework.

Constructor


BaseTool(self, name: str, description: str)
            

Methods

get_schema

Return tool call schema for LLM formatting. Returns: String representation of the tool's parameter schema


get_schema(self) -> str
                    

get_usage_examples

Return example tool calls for LLM guidance. Returns: List of example tool call strings


get_usage_examples(self) -> List[str]
                    

run

Execute the tool with the given parameters. Returns: Dict containing the tool's results or error information


run(self, **kwargs: Any) -> Dict[str, Any]
                    

validate_and_run

Validate parameters then run the tool.


validate_and_run(self, **kwargs: Any) -> Dict[str, Any]