Skip to main content
Glama

Hide

by hide-org
collection.py865 B
"""Collection classes for managing multiple tools.""" from typing import Any from .base import ( BaseAnthropicTool, ToolError, ToolFailure, ToolResult, ) class ToolCollection: """A collection of anthropic-defined tools.""" def __init__(self, *tools: BaseAnthropicTool): self.tools = tools self.tool_map = {tool.to_params()["name"]: tool for tool in tools} def to_params( self, ) -> list[dict[str, Any]]: return [tool.to_params() for tool in self.tools] async def run(self, *, name: str, tool_input: dict[str, Any]) -> ToolResult: tool = self.tool_map.get(name) if not tool: return ToolFailure(error=f"Tool {name} is invalid") try: return await tool(**tool_input) except ToolError as e: return ToolFailure(error=e.message)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hide-org/hide-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server