Skip to main content
Glama
OriginQ

QPanda3 Runtime MCP Server

by OriginQ

add_product_rule_tool

Generate all combinations of specified circuits with observables in quantum computing workflows, similar to Python's itertools.product function.

Instructions

Add product (Cartesian product) rule to CircuitObservableBinding.

This generates all combinations of the specified circuits with the specified observables. This is analogous to Python's itertools.product function.

For example, if circuit_indices=[0,1,2] and observable_indices=[0,1], it generates combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1).

Args: binding_id: The ID returned by create_circuit_observable_binding_tool. circuit_indices: List of circuit indices to include in the product. observable_indices: List of observable indices to include in the product.

Returns: Dictionary containing: - status: "success" or "error" - binding_id: The binding ID - combinations_added: Number of combinations added - message: Status description

Example: # Add all combinations of 3 circuits with 2 observables (6 total) result = add_product_rule_tool( binding_id="your_binding_id", circuit_indices=[0, 1, 2], observable_indices=[0, 1] ) # This adds combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
binding_idYes
circuit_indicesYes
observable_indicesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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 that this is an additive operation ('Add product rule') and describes the combinatorial behavior with an example. However, it lacks details on permissions, error handling, or side effects (e.g., whether it modifies an existing binding irreversibly). The return dictionary is documented, which adds some behavioral context.

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 appropriately sized. It starts with a clear purpose statement, provides an analogy and example, lists args and returns in labeled sections, and includes a practical code example. Every sentence adds value without redundancy, 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.

Completeness5/5

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

Given the complexity (combinatorial operation with 3 parameters), no annotations, and an output schema present (implied by the Returns section), the description is complete. It covers purpose, usage, parameters, return values, and provides an example. The output schema details are fully described in the Returns section, eliminating the need for further explanation.

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?

Schema description coverage is 0%, so the description must fully compensate. It provides detailed semantics for all three parameters: 'binding_id' is explained as 'The ID returned by create_circuit_observable_binding_tool', and 'circuit_indices' and 'observable_indices' are described with examples showing they are lists of integers for combinations. This adds significant meaning 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: 'Add product (Cartesian product) rule to CircuitObservableBinding' with a specific verb ('Add'), resource ('product rule'), and target ('CircuitObservableBinding'). It distinguishes from siblings like 'add_zip_rule_tool' by specifying the Cartesian product operation and provides an analogy to Python's itertools.product for clarity.

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 clear context for when to use this tool: to generate all combinations of circuits with observables, analogous to itertools.product. It implicitly distinguishes from 'add_zip_rule_tool' (likely for pairing rather than full product) but does not explicitly state when not to use it or name alternatives. The example reinforces the usage context effectively.

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