Mock search tool with complex schema.
| 64 | |
| 65 | |
| 66 | class MockSearchTool(Tool): |
| 67 | """Mock search tool with complex schema.""" |
| 68 | |
| 69 | @property |
| 70 | def name(self) -> str: |
| 71 | return "search_database" |
| 72 | |
| 73 | @property |
| 74 | def description(self) -> str: |
| 75 | return "Search the database" |
| 76 | |
| 77 | @property |
| 78 | def parameters(self) -> dict[str, Any]: |
| 79 | return { |
| 80 | "type": "object", |
| 81 | "properties": { |
| 82 | "query": { |
| 83 | "type": "string", |
| 84 | "description": "Search query", |
| 85 | }, |
| 86 | "filters": { |
| 87 | "type": "object", |
| 88 | "properties": { |
| 89 | "category": {"type": "string"}, |
| 90 | "min_price": {"type": "number"}, |
| 91 | "max_price": {"type": "number"}, |
| 92 | }, |
| 93 | }, |
| 94 | "limit": { |
| 95 | "type": "integer", |
| 96 | "minimum": 1, |
| 97 | "maximum": 100, |
| 98 | "default": 10, |
| 99 | }, |
| 100 | }, |
| 101 | "required": ["query"], |
| 102 | } |
| 103 | |
| 104 | async def execute(self, **kwargs) -> ToolResult: |
| 105 | return ToolResult(success=True, content="Search results") |
| 106 | |
| 107 | |
| 108 | class MockEnumTool(Tool): |
no outgoing calls