Skip to main content
Glama

Set Scene Return

set_scene_return

Use this when you need to set how the script returns its assembly. Replace the final top-level return statement with return <assembly>.model(); or return <assembly>.solvedModel(poses, options?);. Use solvedModel for mate-authored mechanisms so FK and validation run. Returns modified source plus diagnostics from re-evaluation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe .kcad.ts source code.
modeYes
posesNoOptional solvedModel pose overrides keyed by mate name. Defaults to {}.
optionsNoOptional solvedModel options such as { validate: 'warn', posesGate: 'envelope' }.
assembly_bindingYesJS identifier bound to assembly(...).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the edit applied and re-evaluated cleanly.
errorNoFailure message (present when ok is false).
new_codeNoModified .kcad.ts source (present on success). Caller persists it.
diagnosticsNoDiagnostics from re-evaluating the modified source.
binding_nameNoJS const name bound to the new construct (when one was created).

TDQS

A4.4/5.0
Behavior4/5

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

Annotations indicate the tool is not read-only and not destructive; the description confirms it modifies source code and re-evaluates. Adds specifics about replacing the return statement and returning diagnostics, which exceeds annotation-provided information.

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?

Three sentences: first states purpose, second details the two return methods, third gives use-case guidance and output summary. No wasted words; front-loaded with core action.

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

Completeness4/5

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

Given 5 parameters (3 required), schema coverage of 80%, and existence of an output schema, the description sufficiently explains tool behavior and return values. Slightly light on edge cases but adequate for selecting and invoking correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description adds meaningful context beyond the schema's parameter descriptions: explains the difference between 'model' and 'solvedModel' modes and when to use each. For 'poses' and 'options', hints at their purpose in solvedModel, though schema already covers them. With 80% schema coverage, description still adds value.

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 modifies the script's return statement, specifying exact substitutions (`model()` or `solvedModel()`). It uniquely identifies its function among siblings, focusing on assembly return behavior.

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?

Provides explicit guidance on when to use the tool ('Use this when you need to set how the script returns its assembly') and when to choose each mode ('Use solvedModel for mate-authored mechanisms'). Does not explicitly mention when not to use it, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.9/5.0
Disambiguation4/5

Tools are mostly distinct, with clear descriptions for each. However, there is some potential overlap between inspection tools like 'inspect' and 'mesh_summary', and between rendering tools 'render_preview' and 'get_latest_render', which could cause minor confusion.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern, making it predictable for an agent to infer functionality.

Tool Count2/5

44 tools is significantly higher than the typical well-scoped range of 3-15. While the domain is complex, the count feels excessive and could overwhelm an agent.

Completeness4/5

The tool set covers an extensive range of CAD operations including creation, inspection, rendering, export, and verification. Minor gaps exist, such as direct sketch editing tools, but overall it is comprehensive.