You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add health filtering to agent_tools() method (#32)
* Add health filtering to agent_tools() method
- Add check_health parameter to filter tools by server health status
- Defaults to True for best performance and JavaScript SDK parity
- Add _get_healthy_servers() helper method for batch health checking
- Silently skip unhealthy servers (timeout, unreachable, unknown)
- Add comprehensive unit tests for health filtering scenarios
- Update existing tests to mock server_health
- Update README with health filtering examples
- Maintains full backward compatibility via check_health=False option
*`client.tools(server_name: str) -> list[dict]` - Returns the tool schema definitions for only the specified server.
144
147
145
-
*`client.agent_tools() -> list[Callable]` - Returns a list of self-contained, callable functions suitable for agentic frameworks.
148
+
*`client.agent_tools(servers: list[str] | None = None, *, check_health: bool = True) -> list[Callable]` - Returns a list of self-contained, callable functions suitable for agentic frameworks. By default, filters to healthy servers only. Use `servers` to filter by server names, or `check_health=False` to include all servers regardless of health.
146
149
147
150
*`client.clear_agent_tools_cache()` - Clears cached generated callable functions that are created when calling agent_tools().
0 commit comments