uptrace_search_services
Discover available services in your system by searching for services that have reported spans within a specified time period.
Instructions
Search for services that have reported spans. Useful for discovering available services in the system.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | Number of hours to look back (default: 24) |
Implementation Reference
- src/uptrace_mcp/server.py:607-629 (handler)The handler implementation for the 'uptrace_search_services' tool, which calculates the time range and calls the client to fetch services.
elif name == "uptrace_search_services": hours = arguments.get("hours", 24) time_lt = datetime.now(timezone.utc) time_gte = time_lt - timedelta(hours=hours) logger.info(f"Fetching services for last {hours} hours") services = client.get_services(time_gte=time_gte, time_lt=time_lt) lines = [ "# Services", f"**Time Range**: Last {hours} hours", f"**Total Services**: {len(services)}", "", ] if services: lines.append("## Service List") for service in services: lines.append(f"- {service}") else: lines.append("No services found.") return [TextContent(type="text", text="\n".join(lines))] - src/uptrace_mcp/server.py:250-263 (schema)Registration and input schema definition for the 'uptrace_search_services' tool.
Tool( name="uptrace_search_services", description="Search for services that have reported spans. Useful for discovering available services in the system.", inputSchema={ "type": "object", "properties": { "hours": { "type": "integer", "description": "Number of hours to look back (default: 24)", "default": 24, }, }, }, ),