Skip to main content
Glama
OriginQ

QPanda3 Runtime MCP Server

by OriginQ

sample_tool

Execute quantum circuits on QPU devices to obtain measurement outcome distributions through sampling, enabling statistical analysis of quantum computations.

Instructions

Execute quantum circuit sampling task.

Submit a quantum circuit for sampling on a QPU device. Sampling executes the circuit multiple times and returns the measurement outcome distribution.

Args: circuit: Quantum circuit(s) to execute. Accepts: - Single circuit as string (QProg/QCircuit/OriginIR format) - List of circuits for batch execution - OriginIR example: QINIT 2 CREG 2 H q[0] CNOT q[0],q[1] MEASURE q[0],c[0] MEASURE q[1],c[1] device_id: Target device ID (e.g., '20'). Use list_qpu_devices_tool to find available devices. shots: Number of sampling shots (default: 1000). Higher values give more statistical accuracy. measure_qubits: Qubit indices to measure (optional). If not specified, uses measurement operations in the circuit.

Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - device_id: Target device - shots: Number of shots requested - message: Status message - note: Instructions for retrieving results

Example: # Submit a Bell state circuit for sampling result = sample_tool( circuit="QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]\nMEASURE q[0],c[0]\nMEASURE q[1],c[1]", device_id="20", shots=1000 ) task_id = result["task_id"]

Note: Use get_task_status_tool to check progress and get_task_results_tool to retrieve results after the task completes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
circuitYes
device_idYes
shotsNo
measure_qubitsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/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 effectively describes the tool's behavior: it submits circuits for asynchronous execution, returns a task ID for tracking, requires follow-up tools to get results, and explains the sampling process (multiple executions to get measurement distribution). It mentions statistical accuracy implications of the shots parameter. It doesn't cover rate limits or authentication requirements, but provides substantial operational context.

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 well-structured with clear sections (Args, Returns, Example, Note) and front-loaded purpose. Most sentences earn their place by providing essential information. It could be slightly more concise in the circuit format explanation, but overall efficiently conveys complex information without unnecessary verbosity.

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 (quantum computing task with 4 parameters, no annotations, but with output schema), the description is remarkably complete. It covers purpose, parameters, return values, usage workflow, examples, and integration with sibling tools. The output schema exists, so the description appropriately focuses on operational context rather than duplicating return structure details.

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. It explains each parameter's purpose, format options, and constraints: 'circuit' accepts multiple formats with examples, 'device_id' references how to find available devices, 'shots' explains default and effect on accuracy, and 'measure_qubits' clarifies optional usage. The description adds significant 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 tool's purpose with specific verbs ('execute quantum circuit sampling task', 'submit a quantum circuit for sampling') and identifies the resource (QPU device). It distinguishes from sibling tools like 'batch_sample_tool' by focusing on single/batch circuit sampling rather than batch-specific operations, and from 'estimate_tool' by specifying sampling vs. estimation tasks.

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 provides explicit guidance on when to use this tool: for quantum circuit sampling on QPU devices. It names alternatives for related tasks: 'list_qpu_devices_tool' to find available devices, 'get_task_status_tool' to check progress, and 'get_task_results_tool' to retrieve results. It also distinguishes from batch operations by handling both single and batch circuits.

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/OriginQ/qpanda3-runtime-mcp-server'

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