MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / TranslateTool

Class TranslateTool

examples/06_tool_schema_demo.py:120–150  ·  view source on GitHub ↗

Example translate tool.

Source from the content-addressed store, hash-verified

118
119
120class TranslateTool(Tool):
121 """Example translate tool."""
122
123 @property
124 def name(self) -> str:
125 return "translate"
126
127 @property
128 def description(self) -> str:
129 return "Translate text from one language to another"
130
131 @property
132 def parameters(self) -> dict[str, Any]:
133 return {
134 "type": "object",
135 "properties": {
136 "text": {
137 "type": "string",
138 "description": "Text to translate",
139 },
140 "target_language": {
141 "type": "string",
142 "description": "Target language code (e.g. 'en', 'es', 'fr')",
143 },
144 },
145 "required": ["text", "target_language"],
146 }
147
148 async def execute(self, **kwargs) -> ToolResult:
149 """Mock execute method."""
150 return ToolResult(success=True, content="Translation result")
151
152
153async def demo_tool_schemas():

Callers 1

demo_multiple_toolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected