Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

measure_frequency

Measure signal frequency on PicoScope oscilloscope channels after capturing data. Use this tool to analyze waveforms and obtain frequency measurements in Hz.

Instructions

Measure signal frequency on a channel.

Note: This requires a recent capture. Call capture_block first.

Args: channel: Channel to measure.

Returns: Dictionary containing frequency in Hz and measurement details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'measure_frequency' tool, decorated with @mcp.tool(). It checks device connection and channel configuration, currently returns guidance on usage as implementation is stubbed pending capture data.
    @mcp.tool()
    def measure_frequency(channel: Literal["A", "B", "C", "D"]) -> dict[str, Any]:
        """Measure signal frequency on a channel.
    
        Note: This requires a recent capture. Call capture_block first.
    
        Args:
            channel: Channel to measure.
    
        Returns:
            Dictionary containing frequency in Hz and measurement details.
        """
        try:
            if not device_manager.is_connected():
                return {
                    "status": "error",
                    "error": "No device connected",
                }
    
            # Check if channel is configured
            if channel not in device_manager.channel_configs:
                return {
                    "status": "error",
                    "error": f"Channel {channel} not configured. Configure and capture first.",
                }
    
            # For now, we need to guide the user to capture data first
            # In a real implementation, we might store the last capture
            return {
                "status": "info",
                "message": "To measure frequency: 1) Configure channel, 2) Set trigger, 3) Capture block, then extract frequency from captured data",
                "channel": channel,
            }
    
        except Exception as e:
            return {
                "status": "error",
                "error": str(e),
                "channel": channel,
            }
  • Top-level registration call to register_analysis_tools(mcp), which defines and registers the measure_frequency tool using nested @mcp.tool() decorators.
    register_analysis_tools(mcp)
  • The registration function that contains the @mcp.tool() decorated measure_frequency handler and other analysis tools.
    def register_analysis_tools(mcp: Any) -> None:
        """Register signal analysis tools with the MCP server."""
  • Helper function imported but not yet used in measure_frequency, intended for frequency calculation from time and voltage arrays.
    def calculate_frequency(time_values: np.ndarray, voltage_values: np.ndarray) -> float:
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the prerequisite of a recent capture, which is useful behavioral context. However, it lacks details on permissions, rate limits, error conditions, or what happens if no capture exists, leaving gaps in transparency.

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 well-structured and front-loaded with the core purpose, followed by a note and parameter/return details. Every sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's moderate complexity, no annotations, and an output schema (implied by 'Returns'), the description is fairly complete. It covers purpose, prerequisites, parameters, and returns, but could improve by addressing error cases or linking to sibling tools more explicitly.

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

Parameters4/5

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

The schema has 0% description coverage, but the description compensates by explaining that 'channel' is the 'Channel to measure' and lists the return structure. This adds meaningful context beyond the enum values in the schema, though it could elaborate on channel semantics (e.g., what A-D represent).

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 ('measure signal frequency') and resource ('on a channel'), making the purpose evident. However, it doesn't explicitly differentiate from sibling measurement tools like measure_amplitude or measure_pulse_width, which prevents a perfect score.

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 explicit guidance to 'call capture_block first' as a prerequisite, which is helpful. It doesn't specify when to use this tool over alternatives like compute_fft or other measurement tools, so it's not fully comprehensive.

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/markuskreitzer/picoscope_mcp'

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