Example flows
DiffBeam MCP examples for optical design
These examples show when a compatible AI client should call DiffBeam and how the result should be presented to the user. DiffBeam does not host or proxy a language model; it is the deterministic optics service behind validation, simulation, catalog lookup, immutable links, and preview-first workspace updates.
Fiber collimator from a mode-field diameter
A user asks for a fiber collimator around 852 nm with roughly a 2 mm output radius. The client should first
search for compatible fiber collimators and lenses, then validate the authored source and lens spacing before
simulating. The response should explain that w0 is radius, not diameter, and should show any
convergence warnings before recommending the layout.
{
"tool": "validate_optical_system",
"arguments": {
"spec": {
"wavelength": { "value": 852, "unit": "nm", "fixed": true },
"optical_chain": [
{
"stage": 0,
"type": "fiber_end",
"parameters": {
"dz": { "value": 0, "unit": "mm", "fixed": true },
"mfd": { "value": 5.3, "unit": "µm", "fixed": true }
},
"resultingBeam": {}
},
{
"stage": 1,
"type": "lens",
"parameters": {
"f": { "value": 15, "unit": "mm", "fixed": true },
"dz": { "unit": "mm", "fixed": true, "expr": "l1_f" },
"rel_to": { "value": 1, "unit": "unitless", "fixed": true }
},
"resultingBeam": {}
}
]
}
}
}
After validation passes, call simulate_optical_system with the same spec. If the user asks for a
shareable result, call create_design_link; that link does not grant workspace edit authority.
Worked guides for search and agent discovery
Use these complete workflows when the user's request matches a common engineering task. Each guide separates a fast physical first pass from optional catalog lookup and links the native MCP flow to the no-install Direct Agent Bridge.
- 4F Gaussian beam expander: 4 mm to 12 mm
- Fiber collimation from mode-field diameter
- Gaussian beam waist placement
- Practical focal-length and catalog strategy
For an open planner workspace, use the Direct Agent Bridge to publish the first calculated preview without installing native MCP.
Two-lens beam expander proposal
For a beam expander request, the AI client should ask enough context to avoid a vague answer: wavelength,
input waist or collimated radius, desired magnification, available lens signs, and any length limit. The
client can use search_lenses to find real focal lengths, construct Galilean or Keplerian spacing
with expressions such as l1_f + l2_f, and call validate_optical_system before
simulation.
{
"tool": "search_lenses",
"arguments": {
"query": "25 mm achromat 852 nm",
"wavelength_nm": 852,
"focal_length_mm": 25,
"diameter_mm": 12.7,
"limit": 5
}
}
The final answer should distinguish a physically simulated proposal from a catalog suggestion. It should not claim vendor availability beyond the catalog result fields, and it should link users to the planner when they need to inspect or adjust the solved system.
Workspace preview before apply
If a user has an open planner workspace, the connection dialog issues a
workspace_credential scoped to read, preview, revision reads, and optionally apply. The client
passes that credential as a tool argument to workspace tools. It must not store the credential in URLs,
headers, model settings, or checked-in mcp.json files.
{
"tool": "preview_workspace_design",
"arguments": {
"public_workspace_id": "wsp_example000000000000001",
"workspace_credential": "issued-in-the-planner",
"expected_revision": 7,
"spec": { "...": "validated optical system" }
}
}
A preview is not a write. Applying requires the correct revision and a credential with the
workspace:apply scope. Human confirmation remains the default. If auto-apply is disabled, the
assistant should stop at the proposal and let the user approve inside DiffBeam.
Discovery monitoring boundary
Discovery monitoring is intentionally narrow. The static pages are unique, canonical, and product-specific; there are no thin search pages for copied keyword permutations. Production telemetry remains off unless separately reviewed, and local or future production discovery signals must stay redacted, aggregate, and separated from raw prompts, optical designs, workspace credentials, and model identity.