Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

measure_thd

Calculate Total Harmonic Distortion (THD) percentage and harmonic components from PicoScope oscilloscope signals to analyze signal purity and identify distortion issues.

Instructions

Measure Total Harmonic Distortion (THD).

Args: channel: Channel to measure.

Returns: Dictionary containing THD percentage and harmonic components.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the 'measure_thd' tool logic. It is decorated with @mcp.tool() for automatic registration with the MCP server. Currently a placeholder with TODO for full implementation.
    @mcp.tool()
    def measure_thd(channel: Literal["A", "B", "C", "D"]) -> dict[str, Any]:
        """Measure Total Harmonic Distortion (THD).
    
        Args:
            channel: Channel to measure.
    
        Returns:
            Dictionary containing THD percentage and harmonic components.
        """
        # TODO: Implement THD measurement
        return {"status": "not_implemented", "channel": channel}
  • The call to register_analysis_tools(mcp) in the main server file, which triggers the definition and registration of the measure_thd tool.
    register_analysis_tools(mcp)
  • Import of register_analysis_tools from analysis.py in the server.py file, necessary for registering the analysis tools including measure_thd.
    from .tools.analysis import register_analysis_tools
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions what the tool does and the return format but omits critical details like whether this is a read-only operation, if it requires specific device states, potential side effects, or error conditions. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the main purpose stated first followed by brief parameter and return details. However, the 'Args:' and 'Returns:' sections are somewhat redundant given the structured fields, slightly reducing efficiency.

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

Completeness3/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 (a measurement operation with one parameter), no annotations, and an output schema that covers return values, the description is minimally adequate. It explains the purpose and return structure but lacks context on usage, prerequisites, and behavioral traits, leaving gaps for the agent.

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?

The description adds minimal value beyond the input schema. It states that 'channel' is the channel to measure, which is implied by the schema's enum values (A, B, C, D). With 0% schema description coverage, the description doesn't compensate by explaining channel semantics or measurement context, meeting only the baseline expectation.

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 verb ('Measure') and resource ('Total Harmonic Distortion (THD)'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling measurement tools like measure_amplitude or measure_frequency, 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 Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., whether a device must be connected or configured first) or comparisons with other measurement tools, leaving the agent to infer usage.

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