Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

set_timebase

Configure the sampling rate for PicoScope oscilloscope data acquisition by specifying sample interval and number of samples to optimize signal capture.

Instructions

Set the timebase (sampling rate) for data acquisition.

Note: The actual timebase is determined during block capture based on the requested number of samples. This tool is informational.

Args: sample_interval_ns: Desired sample interval in nanoseconds. num_samples: Number of samples to capture.

Returns: Dictionary containing timebase information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sample_interval_nsYes
num_samplesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'set_timebase' tool. It is decorated with @mcp.tool(), which handles both registration and schema definition via type annotations. The function calculates sample rate and returns configuration info, noting that actual timebase is set during capture.
    @mcp.tool()
    def set_timebase(sample_interval_ns: int, num_samples: int) -> dict[str, Any]:
        """Set the timebase (sampling rate) for data acquisition.
    
        Note: The actual timebase is determined during block capture based on
        the requested number of samples. This tool is informational.
    
        Args:
            sample_interval_ns: Desired sample interval in nanoseconds.
            num_samples: Number of samples to capture.
    
        Returns:
            Dictionary containing timebase information.
        """
        try:
            if not device_manager.is_connected():
                return {
                    "status": "error",
                    "error": "No device connected",
                }
    
            # Calculate approximate sample rate
            sample_rate_hz = 1_000_000_000 / sample_interval_ns if sample_interval_ns > 0 else 0
    
            return {
                "status": "success",
                "note": "Timebase will be set during capture based on device capabilities",
                "requested_interval_ns": sample_interval_ns,
                "requested_sample_rate_hz": sample_rate_hz,
                "num_samples": num_samples,
            }
    
        except Exception as e:
            return {
                "status": "error",
                "error": str(e),
            }
  • The call to register_configuration_tools(mcp) which invokes the registration of the set_timebase tool (along with other configuration tools).
    register_configuration_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool is 'informational' and that timebase is 'determined during block capture,' which hints at non-destructive, read-like behavior, but doesn't explicitly state whether this requires device connection, affects ongoing acquisitions, has rate limits, or what happens if parameters conflict with hardware capabilities. More behavioral context is needed for a mutation-sounding tool.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by a note on behavioral context, then clearly labeled sections for args and returns. Every sentence earns its place, with no redundant or vague phrasing, making it easy to scan and understand.

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 (2 parameters, informational role) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers purpose, behavioral nuance, and parameter semantics. However, without annotations and with sibling tools like 'capture_block,' it could benefit from more explicit integration guidance to be fully self-contained.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics by explaining that 'sample_interval_ns' is the 'desired sample interval in nanoseconds' and 'num_samples' is the 'number of samples to capture,' and links them to 'timebase information' and 'block capture.' This goes beyond the bare schema types (integers) and provides context, though it doesn't detail valid ranges or units beyond nanoseconds.

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 with a specific verb ('Set') and resource ('timebase for data acquisition'), and distinguishes it from siblings by mentioning it's 'informational' rather than directly controlling hardware. However, it doesn't explicitly differentiate from tools like 'configure_channel' or 'configure_downsampling' that might also affect acquisition parameters.

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

Usage Guidelines3/5

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

The description provides implied usage context by noting this tool is 'informational' and that the 'actual timebase is determined during block capture,' suggesting it should be used for planning or configuration rather than real-time control. However, it doesn't explicitly state when to use this versus alternatives like 'capture_block' or 'configure_downsampling,' nor does it provide clear exclusions or prerequisites.

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