Skip to main content
Glama

get_metric_samples

Retrieve raw metric samples within a specified time range from Fulcra Context MCP, including samples with intersecting ranges and timezone-adjusted timestamps.

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
metric_nameYes
start_timeYes
end_timeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_metric_samples' MCP tool. It is registered via the @mcp.tool() decorator. Retrieves raw metric samples using FulcraAPI.metric_samples and formats the result as a JSON string.
    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)
        )
Behavior4/5

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

With no annotations provided, the description carries full burden and does an excellent job disclosing key behavioral traits: it explains the range intersection logic for samples covering time ranges, specifies that result timestamps include time zones, and instructs to translate to user's local time zone when known. It also clarifies the inclusive/exclusive nature of the time boundaries. The only minor gap is lack of information about pagination, rate limits, or error conditions.

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 perfectly structured and appropriately sized. It begins with a clear purpose statement, follows with important behavioral details, then provides organized parameter documentation in an Args/Returns format. Every sentence earns its place by adding essential information, with no redundant or verbose content.

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

Completeness5/5

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

Given the tool's complexity (time-based querying with specific behavioral rules), no annotations, and the presence of an output schema (which handles return value documentation), the description is remarkably complete. It covers purpose, usage context, detailed parameter semantics, and important behavioral characteristics like range intersection logic and time zone handling. The output schema will document the return structure, so the description appropriately focuses on operational aspects.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics in the Args section. It explains what metric_name represents and references get_metrics_catalog for finding available metrics. It clarifies the format requirements for start_time and end_time (ISO 8601 or datetime object) and specifies their inclusive/exclusive behavior. This adds substantial value beyond the bare schema.

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?

The description clearly states the specific action ('retrieve raw samples'), target resource ('a given metric'), and scope ('for the user during a specified period'). It distinguishes from siblings like get_metric_time_series (which likely returns aggregated/processed data rather than raw samples) and get_metrics_catalog (which lists available metrics rather than retrieving samples).

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?

The description provides clear context about when to use this tool (retrieving raw samples for a specific metric within a time range) and explicitly references get_metrics_catalog as a prerequisite for finding available metric names. However, it doesn't explicitly state when NOT to use it or compare alternatives like get_metric_time_series, which would be helpful for sibling differentiation.

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

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