Skip to main content
Glama
ajragusa

perfsonar-mcp

by ajragusa

get_measurement_data

Retrieve raw time-series network measurement data for analysis of throughput, latency, and packet loss from perfSONAR archives.

Instructions

Get raw time-series data for a specific measurement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metadataKeyYesMetadata key from query
eventTypeYesEvent type
summaryTypeNoSummary type
summaryWindowNoSummary window in seconds
timeRangeNoTime range in seconds

Implementation Reference

  • The actual implementation of fetching measurement data from the PerfSONAR API.
    async def get_measurement_data(
        self, params: MeasurementDataParams
    ) -> List[TimeSeriesDataPoint]:
        """
        Get measurement data for a specific event type
    
        Args:
            params: Parameters specifying which measurement data to retrieve
    
        Returns:
            List of time series data points
        """
        logger.info(f"Getting measurement data for event type: {params.event_type}")
        logger.debug(f"Measurement data parameters: {params}")
        try:
            # Build the URL path
            path = f"/{params.metadata_key}/{params.event_type}"
    
            if params.summary_type and params.summary_window:
                path += f"/{params.summary_type}/{params.summary_window}"
            else:
                path += "/base"
    
            logger.debug(f"Request path: {path}")
    
            # Build query params
            query_params: Dict[str, Any] = {}
            if params.time_start:
                query_params["time-start"] = params.time_start
            if params.time_end:
                query_params["time-end"] = params.time_end
            if params.time_range:
                query_params["time-range"] = params.time_range
    
            response = await self.client.get(path, params=query_params)
            response.raise_for_status()
    
            data = response.json()
            logger.info(f"Retrieved {len(data)} data points")
            return [TimeSeriesDataPoint.model_validate(item) for item in data]
        except httpx.HTTPStatusError as e:
            logger.error(f"HTTP error getting measurement data: {e.response.status_code}")
  • The MCP tool handler that defines the 'get_measurement_data' tool and calls the client implementation.
    async def get_measurement_data(
        metadataKey: str,
        eventType: str,
        summaryType: Optional[str] = None,
        summaryWindow: Optional[int] = None,
        timeRange: Optional[int] = None,
    ) -> str:
        """Get raw time-series data for a specific measurement.
    
        Args:
            metadataKey: Metadata key from query results
            eventType: Event type (e.g., 'throughput', 'histogram-owdelay')
            summaryType: Summary type (e.g., 'average', 'aggregation')
            summaryWindow: Summary window in seconds
            timeRange: Time range in seconds from now
    
        Returns:
            JSON string with time-series measurement data
        """
        params = MeasurementDataParams(
            metadata_key=metadataKey,
            event_type=eventType,
            summary_type=summaryType,
            summary_window=summaryWindow,
            time_range=timeRange,
        )
        results = await perfsonar_client.get_measurement_data(params)
  • Where the 'get_measurement_data' tool is registered and handled in the generic MCP server implementation.
    elif name == "get_measurement_data":
        params = MeasurementDataParams(
            metadata_key=arguments["metadataKey"],
            event_type=arguments["eventType"],
            summary_type=arguments.get("summaryType"),
            summary_window=arguments.get("summaryWindow"),
            time_range=arguments.get("timeRange"),
        )
        results = await self.client.get_measurement_data(params)
        return CallToolResult(
            content=[
                TextContent(
                    type="text",
                    text=json.dumps([r.model_dump() for r in results], indent=2),
                )
            ]
        )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool 'gets' data, implying a read-only operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, data format, or potential side effects. This is inadequate for a tool with 5 parameters and no output schema.

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 with no wasted words. It's front-loaded with the core purpose, making it easy 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 complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'raw time-series data' entails, how parameters interact, or what the return values are, leaving significant gaps for an AI agent to understand the tool's behavior.

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 description coverage is 100%, so the schema already documents all 5 parameters. The description adds no additional meaning beyond implying time-series data retrieval, which aligns with parameters like 'timeRange' and 'summaryWindow'. Baseline 3 is appropriate as the schema handles parameter documentation.

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 action ('Get') and resource ('raw time-series data for a specific measurement'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_latency', 'get_packet_loss', or 'get_throughput', which also retrieve measurement-related data, so it lacks sibling differentiation.

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. It doesn't mention prerequisites, context (e.g., after querying measurements), or comparisons to siblings like 'query_measurements' or other 'get_' tools, leaving usage unclear.

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