Skip to main content
Glama

Add Mate

add_mate

Use this when you need to author a mate-graph relationship into the source, selected by relation (default 'mate'):

  • 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limitsDeg?, limitsMm? }).

  • 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }).

  • 'transmission' — a physical drive path across mates ({ name, kind, sourceMate, drivenMates, path, ... }). All durably edit source and need { code, assembly_binding }. Params other than relation are forwarded verbatim; each relation fails closed on its own missing required params.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aNorelation:'mate' — connector ref "<partName>.<connectorName>".
bNorelation:'mate' — connector ref "<partName>.<connectorName>".
codeYesThe .kcad.ts source code.
kindNorelation:'transmission' — transmission kind.
nameNorelation:'mate'|'transmission' — name unique within the assembly.
pathNorelation:'transmission' — drive path.
poseNorelation:'mate' — optional mate pose.
typeNorelation:'mate' — mate type.
inputNorelation:'transmission' — optional input.
notesNorelation:'transmission' — optional notes.
ratioNorelation:'coupling' — driven pose = source pose * ratio + offset.
drivenNorelation:'coupling' — driven mate name.
offsetNorelation:'coupling' — optional pose offset.
outputNorelation:'transmission' — optional output.
sourceNorelation:'coupling' — source mate name.
actuatorNorelation:'transmission' — optional actuator.
limitsMmNorelation:'mate' — optional [minMm, maxMm].
relationNoWhich relationship to author (default 'mate').
limitsDegNorelation:'mate' — optional [minDeg, maxDeg].
sourceMateNorelation:'transmission' — source mate name.
drivenMatesNorelation:'transmission' — driven mate names.
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).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedInput schema / allOf
      Previous value: -[
      -  {
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "const": "coupling"
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {
      -      "required": [
      -        "driven",
      -        "source",
      -        "ratio"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "const": "transmission"
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {
      -      "required": [
      -        "name",
      -        "kind",
      -        "sourceMate",
      -        "drivenMates",
      -        "path"
      -      ]
      -    }
      -  },
      -  {
      -    "else": {
      -      "required": [
      -        "name",
      -        "a",
      -        "b",
      -        "type"
      -      ]
      -    },
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "enum": [
      -            "coupling",
      -            "transmission"
      -          ]
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {}
      -  }
      -]New value: +[
      +  {
      +    "if": {
      +      "anyOf": [
      +        {
      +          "not": {
      +            "required": [
      +              "relation"
      +            ]
      +          }
      +        },
      +        {
      +          "properties": {
      +            "relation": {
      +              "const": "mate"
      +            }
      +          },
      +          "required": [
      +            "relation"
      +          ]
      +        }
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "name",
      +        "a",
      +        "b",
      +        "type"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "coupling"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "driven",
      +        "source",
      +        "ratio"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "transmission"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "name",
      +        "kind",
      +        "sourceMate",
      +        "drivenMates",
      +        "path"
      +      ]
      +    }
      +  }
      +]
  2. Changed1 schema field changed
    • addedInput schema / allOf
      Added value: +[
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "coupling"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "driven",
      +        "source",
      +        "ratio"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "transmission"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "name",
      +        "kind",
      +        "sourceMate",
      +        "drivenMates",
      +        "path"
      +      ]
      +    }
      +  },
      +  {
      +    "else": {
      +      "required": [
      +        "name",
      +        "a",
      +        "b",
      +        "type"
      +      ]
      +    },
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "enum": [
      +            "coupling",
      +            "transmission"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {}
      +  }
      +]
  3. Changed1 schema field changed
    • removedInput schema / allOf
      Removed value: -[
      -  {
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "const": "coupling"
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {
      -      "required": [
      -        "driven",
      -        "source",
      -        "ratio"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "const": "transmission"
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {
      -      "required": [
      -        "name",
      -        "kind",
      -        "sourceMate",
      -        "drivenMates",
      -        "path"
      -      ]
      -    }
      -  },
      -  {
      -    "else": {
      -      "required": [
      -        "name",
      -        "a",
      -        "b",
      -        "type"
      -      ]
      -    },
      -    "if": {
      -      "properties": {
      -        "relation": {
      -          "enum": [
      -            "coupling",
      -            "transmission"
      -          ]
      -        }
      -      },
      -      "required": [
      -        "relation"
      -      ]
      -    },
      -    "then": {}
      -  }
      -]
  4. Changed1 schema field changed
    • addedInput schema / allOf
      Added value: +[
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "coupling"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "driven",
      +        "source",
      +        "ratio"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "const": "transmission"
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "name",
      +        "kind",
      +        "sourceMate",
      +        "drivenMates",
      +        "path"
      +      ]
      +    }
      +  },
      +  {
      +    "else": {
      +      "required": [
      +        "name",
      +        "a",
      +        "b",
      +        "type"
      +      ]
      +    },
      +    "if": {
      +      "properties": {
      +        "relation": {
      +          "enum": [
      +            "coupling",
      +            "transmission"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "relation"
      +      ]
      +    },
      +    "then": {}
      +  }
      +]
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  6. Changed26 schema fields changed
    • changedInput schema / properties / a / description
      Previous value: -"Connector ref: \"<partName>.<connectorName>\" (legacy) or \"@kc[<partName>/connector/<connectorName>]\"."New value: +"relation:'mate' — connector ref \"<partName>.<connectorName>\"."
    • addedInput schema / properties / actuator
      Added value: +{
      +  "description": "relation:'transmission' — optional actuator.",
      +  "type": "string"
      +}
    • removedInput schema / properties / assembly
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / assembly_binding
      Added value: +{
      +  "description": "JS identifier bound to assembly(...).",
      +  "type": "string"
      +}
    • changedInput schema / properties / b / description
      Previous value: -"Connector ref: \"<partName>.<connectorName>\" (legacy) or \"@kc[<partName>/connector/<connectorName>]\"."New value: +"relation:'mate' — connector ref \"<partName>.<connectorName>\"."
    • addedInput schema / properties / code
      Added value: +{
      +  "description": "The .kcad.ts source code.",
      +  "type": "string"
      +}
    • addedInput schema / properties / driven
      Added value: +{
      +  "description": "relation:'coupling' — driven mate name.",
      +  "type": "string"
      +}
    • addedInput schema / properties / drivenMates
      Added value: +{
      +  "description": "relation:'transmission' — driven mate names.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / input
      Added value: +{
      +  "description": "relation:'transmission' — optional input.",
      +  "type": "string"
      +}
    • addedInput schema / properties / kind
      Added value: +{
      +  "description": "relation:'transmission' — transmission kind.",
      +  "enum": [
      +    "direct-horn",
      +    "link-rod",
      +    "four-bar",
      +    "gear-pair",
      +    "belt",
      +    "tendon"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / limitsDeg / description
      Previous value: -"Optional [minDeg, maxDeg] range for revolute/cylindrical/pin_slot mates."New value: +"relation:'mate' — optional [minDeg, maxDeg]."
    • addedInput schema / properties / limitsDeg / items
      Added value: +{
      +  "type": "number"
      +}
    • changedInput schema / properties / limitsMm / description
      Previous value: -"Optional [minMm, maxMm] range for prismatic mates."New value: +"relation:'mate' — optional [minMm, maxMm]."
    • addedInput schema / properties / limitsMm / items
      Added value: +{
      +  "type": "number"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Mate name (unique within the assembly)."New value: +"relation:'mate'|'transmission' — name unique within the assembly."
    • addedInput schema / properties / notes
      Added value: +{
      +  "description": "relation:'transmission' — optional notes.",
      +  "type": "string"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "relation:'coupling' — optional pose offset.",
      +  "type": "number"
      +}
    • addedInput schema / properties / output
      Added value: +{
      +  "description": "relation:'transmission' — optional output.",
      +  "type": "string"
      +}
    • addedInput schema / properties / path
      Added value: +{
      +  "description": "relation:'transmission' — drive path.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / pose / description
      Previous value: -"Optional mate pose: number for scalar mates or [x, y, z] degrees for ball mates."New value: +"relation:'mate' — optional mate pose."
    • addedInput schema / properties / ratio
      Added value: +{
      +  "description": "relation:'coupling' — driven pose = source pose * ratio + offset.",
      +  "type": "number"
      +}
    • addedInput schema / properties / relation
      Added value: +{
      +  "description": "Which relationship to author (default 'mate').",
      +  "enum": [
      +    "mate",
      +    "coupling",
      +    "transmission"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / source
      Added value: +{
      +  "description": "relation:'coupling' — source mate name.",
      +  "type": "string"
      +}
    • addedInput schema / properties / sourceMate
      Added value: +{
      +  "description": "relation:'transmission' — source mate name.",
      +  "type": "string"
      +}
    • addedInput schema / properties / type / description
      Added value: +"relation:'mate' — mate type."
    • changedInput schema / required
      Previous value: -[
      -  "name",
      -  "a",
      -  "b",
      -  "type"
      -]New value: +[
      +  "code",
      +  "assembly_binding"
      +]
  7. Changed2 schema fields changed
    • changedInput schema / properties / a / description
      Previous value: -"Connector ref \"<partName>.<connectorName>\"."New value: +"Connector ref: \"<partName>.<connectorName>\" (legacy) or \"@kc[<partName>/connector/<connectorName>]\"."
    • changedInput schema / properties / b / description
      Previous value: -"Connector ref \"<partName>.<connectorName>\"."New value: +"Connector ref: \"<partName>.<connectorName>\" (legacy) or \"@kc[<partName>/connector/<connectorName>]\"."
  8. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=false and destructiveHint=false, so the tool is not read-only and not destructive. The description adds that it 'durably edit source' and requires code and assembly_binding, plus states that each relation 'fails closed on its own missing required params', providing useful behavioral insight beyond annotations.

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 concise (about 10 lines) with a clear front-loaded purpose statement and bullet-pointed breakdown of the three relation types. Every sentence adds value without redundancy. It is well-structured for quick comprehension.

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 (three distinct operations with many parameters), the description sufficiently covers all key aspects: the three relation types, their parameter shapes, common required params, and error behavior. An output schema exists so return values need not be described. The description stands alone as a complete guide for an AI agent.

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?

Schema coverage is 100%, so baseline is 3. The description groups parameters by relation type (e.g., 'mate' expects { name, a, b, type, pose?, ... }), which adds structural meaning not explicit in the schema's conditional required blocks. It also explains that non-relation parameters are 'forwarded verbatim', clarifying how to use them.

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: 'author a mate-graph relationship into the source'. It breaks down into three specific relation types (mate, coupling, transmission) with distinct parameter sets. This distinctively distinguishes it from sibling tools like add_constraint or add_connector.

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 opens with 'Use this when you need to author a mate-graph relationship', providing clear usage context. It mentions required parameters (code, assembly_binding) and the default relation. However, it does not explicitly compare to alternatives or state when not to use the tool.

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.