Skip to main content
Glama
NaoNaoMe

USBTMC MCP Server

by NaoNaoMe

usbtmc_query

Send SCPI query commands to a USBTMC device and retrieve the response directly, combining send and receive into one action.

Instructions

Send a SCPI command and immediately receive the response.

Use for QUERY commands (with '?') that request information from the device. For SET commands (without '?'), use usbtmc_send() instead.

This is a convenience function combining send and receive operations.

Args: params (QueryInput): Input containing: - device_id (int): The unique identifier returned by usbtmc_connect() - command (str): SCPI command string to send (usually ends with '?') - wait_time (float): Time to wait between send and receive (default: 0.1s) - max_bytes (int): Maximum bytes to read (default: 1024)

Returns: dict: Result containing: - success (bool): Whether the query was successful - device_id (int): The target device_id - command (str): The command that was sent - response (str or None): Response data, or None if no data/timeout - message (str): Success or error message

Note: Wait time recommendations: - Simple queries (*IDN?, status): 0.1s (default) - Querying existing measurements: 0.1s - After changing settings: 0.5-2.0s

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description discloses key behavioral details beyond the minimal annotations: it is a convenience function combining send and receive, waits between operations, and returns None if no data/timeout. It also provides wait-time recommendations for different command types, offering practical behavioral context that the annotations do not convey.

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 with a concise opening sentence, explicit usage rule, Args/Returns sections, and a practical Note. Every sentence adds relevant information—nothing is redundant or filler—and the most important information is front-loaded.

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?

For a tool with one nested parameter object and a non-trivial timing behavior, the description is complete: it covers purpose, when to use, all input fields with defaults, return fields, and time-wait recommendations. It gives an agent everything needed to select and invoke the tool correctly without guessing.

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?

Even though the schema description coverage is reported as 0%, the tool description thoroughly compensates by enumerating all four fields (device_id, command, wait_time, max_bytes), their meanings, defaults, and even usage guidance for wait_time. This adds clear semantic value beyond the raw 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 opens with a clear, specific verb and resource: 'Send a SCPI command and immediately receive the response.' It explicitly frames the tool as the query variant and distinguishes it from usbtmc_send() by mentioning SCPI commands with '?'. This makes the tool's purpose unambiguous and differentiates it from sibling tools.

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

Usage Guidelines5/5

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

The description states exactly when to use this tool: 'Use for QUERY commands (with '?') that request information from the device.' It also explicitly names the alternative: 'For SET commands (without '?'), use usbtmc_send() instead.' This direct when-to-use/when-not-to-use guidance is exemplary.

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/NaoNaoMe/usbtmc-lite-mcp'

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