Skip to main content
Glama
ajragusa

perfsonar-mcp

by ajragusa

get_packet_loss

Measure packet loss between network endpoints to identify connectivity issues and monitor network performance using historical data from perfSONAR.

Instructions

Get packet loss measurements between source and destination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource host/IP address
destinationYesDestination host/IP address
timeRangeNoTime range in seconds
summaryWindowNoSummary window in seconds

Implementation Reference

  • The FastMCP handler function for get_packet_loss, which processes input arguments and calls the perfsonar_client.
    async def get_packet_loss(
        source: str,
        destination: str,
        timeRange: int = 86400,
        summaryWindow: Optional[int] = None,
    ) -> str:
        """Get packet loss measurements between source and destination.
    
        Args:
            source: Source host/IP address
            destination: Destination host/IP address
            timeRange: Time range in seconds (default: 86400 = 24 hours)
            summaryWindow: Summary window in seconds for aggregation
    
        Returns:
            JSON string with packet loss measurement data
        """
        results = await perfsonar_client.get_packet_loss(source, destination, timeRange, summaryWindow)
  • The core client method that implements the actual packet loss data retrieval logic.
    async def get_packet_loss(
        self,
        source: str,
        destination: str,
        time_range: Optional[int] = None,
        summary_window: Optional[int] = None,
    ) -> List[MeasurementResult]:
        """
        Get packet loss measurements between source and destination
    
        Args:
            source: Source host/IP address
            destination: Destination host/IP address
            time_range: Time range in seconds from now
            summary_window: Summary window in seconds
    
        Returns:
            List of measurement results
        """
        logger.info(f"Getting packet loss: {source} -> {destination}")
        metadata = await self.query_measurements(
            MeasurementQueryParams(
                source=source, destination=destination, event_type="packet-loss-rate"
            )
        )
    
        results = []
        for meta in metadata:
            event_type = next(
                (e for e in meta.event_types if e.event_type == "packet-loss-rate"), None
            )
            if not event_type:
                continue
    
            data = await self.get_measurement_data(
                MeasurementDataParams(
                    metadata_key=meta.metadata_key,
                    event_type="packet-loss-rate",
                    summary_type="aggregations" if summary_window else None,
                    summary_window=summary_window,
  • The registration/dispatch logic for get_packet_loss in the standard MCP server implementation.
    elif name == "get_packet_loss":
        results = await self.client.get_packet_loss(
            arguments["source"],
            arguments["destination"],
            arguments.get("timeRange", 86400),
            arguments.get("summaryWindow"),
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but fails to describe how it behaves—e.g., whether it's a read-only operation, if it requires authentication, what the output format looks like, or any rate limits. This leaves significant gaps for an agent to understand the tool's operational traits.

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?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the tool's complexity (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how measurements are calculated, or any behavioral nuances. For a tool that likely involves network diagnostics, more context is needed to guide effective usage.

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?

The input schema has 100% description coverage, so all parameters are documented in the schema itself. The description adds no additional meaning beyond what's in the schema, such as explaining how 'timeRange' and 'summaryWindow' interact or providing examples. This meets the baseline score of 3, as the schema handles the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'Get packet loss measurements between source and destination,' which is a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'get_latency' or 'get_throughput' that also retrieve network measurements, leaving room for confusion about when to use each.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_latency' or 'get_throughput' from the sibling list. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage based solely on the tool name and basic purpose.

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/ajragusa/perfsonar-mcp'

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