Skip to main content
Glama

get_metric_samples

Retrieve raw metric samples for a specified time range, including overlapping ranges, with timestamps adjusted to the user’s local time zone using Fulcra Context MCP.

Instructions

Retrieve the raw samples related to a given metric for the user during a specified period.

In cases where samples cover ranges and not points in time, a sample will be returned if any part of its range intersects with the requested range. For example, if start_time is 14:00 and end_time is 15:00, a sample covering 13:30-14:30 will be included. Result timestamps will include time zones. Always translate timestamps to the user's local time zone when this is known.

Args: metric_name: The name of the metric to retrieve samples for. Use get_metrics_catalog to find available metrics. start_time: The start of the time range (inclusive), as an ISO 8601 string or datetime object. end_time: The end of the time range (exclusive), as an ISO 8601 string or datetime object. Returns: A JSON string representing a list of raw samples for the metric.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_timeYes
metric_nameYes
start_timeYes

Implementation Reference

  • The handler function for the 'get_metric_samples' tool. It is registered via the @mcp.tool() decorator. Fetches raw metric samples from FulcraAPI within the given time range and returns them as a JSON-formatted string.
    @mcp.tool() async def get_metric_samples( metric_name: str, start_time: datetime, end_time: datetime, ) -> str: """Retrieve the raw samples related to a given metric for the user during a specified period. In cases where samples cover ranges and not points in time, a sample will be returned if any part of its range intersects with the requested range. For example, if start_time is 14:00 and end_time is 15:00, a sample covering 13:30-14:30 will be included. Result timestamps will include time zones. Always translate timestamps to the user's local time zone when this is known. Args: metric_name: The name of the metric to retrieve samples for. Use `get_metrics_catalog` to find available metrics. start_time: The start of the time range (inclusive), as an ISO 8601 string or datetime object. end_time: The end of the time range (exclusive), as an ISO 8601 string or datetime object. Returns: A JSON string representing a list of raw samples for the metric. """ fulcra = get_fulcra_object() samples = fulcra.metric_samples( metric=metric_name, start_time=start_time, end_time=end_time, ) return ( f"Raw samples for {metric_name} from {start_time} to {end_time}: " + json.dumps(samples) )

Other Tools

Related 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/fulcradynamics/fulcra-context-mcp'

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