Skip to main content
Glama
dimonb

Uptrace MCP Server

by dimonb

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

TableJSON Schema
NameRequiredDescriptionDefault
hoursNoNumber of hours to look back (default: 24)

Implementation Reference

  • 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))]
  • 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,
                },
            },
        },
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. While 'Search' implies read-only and 'reported spans' provides domain context, the description fails to disclose return format (list of service names? IDs?), pagination behavior, or any permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences total with zero waste. First sentence defines the operation, second explains the utility. Front-loaded with the core action and appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a single-parameter discovery tool with full schema coverage, but gaps remain given the lack of output schema and annotations. Missing description of return values (what constitutes a 'service' object?) and operational safety details that annotations would typically provide.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with the 'hours' parameter fully documented ('Number of hours to look back'). The description does not add parameter-specific context beyond the schema, meeting the baseline for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'Search' + resource 'services' + context 'reported spans' clearly defines the tool's function. Effectively distinguishes from sibling 'uptrace_search_spans' by clarifying this searches for services (the entities) rather than the spans themselves.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides usage context ('Useful for discovering available services') indicating when to use this tool. However, lacks explicit when-not-to-use guidance or named alternatives for different discovery scenarios (e.g., when to use search_groups vs search_services).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/dimonb/uptrace-mcp'

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