Skip to main content
Glama

Add Mate

add_mate
Idempotent

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?, limits_deg?, limits_mm? }).

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

  • 'transmission' — a physical drive path across mates ({ name, kind, source_mate, driven_mates, path, ... }). All durably edit source and need { code, assembly_binding }. The inserted script keeps limitsDeg, limitsMm, sourceMate, and drivenMates; pass limits_deg, limits_mm, source_mate, and driven_mates. Each relation fails closed on its own missing required params.

Input 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.
adhesiveNoOptional planar adhesive interface for a fastened mate. Select one canonical face on each part.
relationNoWhich relationship to author (default 'mate').
limits_mmNorelation:'mate' — optional [minMm, maxMm].
limits_degNorelation:'mate' — optional [minDeg, maxDeg].
source_mateNorelation:'transmission' — source mate name.
driven_matesNorelation:'transmission' — driven mate names.
assembly_bindingYesJS identifier bound to assembly(...).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • removedInput schema / properties / drivenMates
      Removed value: -{
      -  "description": "relation:'transmission' — driven mate names.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • addedInput schema / properties / driven_mates
      Added value: +{
      +  "description": "relation:'transmission' — driven mate names.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / limitsDeg
      Removed value: -{
      -  "description": "relation:'mate' — optional [minDeg, maxDeg].",
      -  "items": {
      -    "type": "number"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / limitsMm
      Removed value: -{
      -  "description": "relation:'mate' — optional [minMm, maxMm].",
      -  "items": {
      -    "type": "number"
      -  },
      -  "type": "array"
      -}
    • addedInput schema / properties / limits_deg
      Added value: +{
      +  "description": "relation:'mate' — optional [minDeg, maxDeg].",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / limits_mm
      Added value: +{
      +  "description": "relation:'mate' — optional [minMm, maxMm].",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / sourceMate
      Removed value: -{
      -  "description": "relation:'transmission' — source mate name.",
      -  "type": "string"
      -}
    • addedInput schema / properties / source_mate
      Added value: +{
      +  "description": "relation:'transmission' — source mate name.",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / adhesive
      Added value: +{
      +  "description": "Optional planar adhesive interface for a fastened mate. Select one canonical face on each part.",
      +  "properties": {
      +    "face_a": {
      +      "enum": [
      +        "left",
      +        "right",
      +        "front",
      +        "back",
      +        "top",
      +        "bottom"
      +      ],
      +      "type": "string"
      +    },
      +    "face_b": {
      +      "enum": [
      +        "left",
      +        "right",
      +        "front",
      +        "back",
      +        "top",
      +        "bottom"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "face_a",
      +    "face_b"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "direct-horn",
      -  "link-rod",
      -  "four-bar",
      -  "gear-pair",
      -  "belt",
      -  "tendon"
      -]New value: +[
      +  "direct",
      +  "link-rod",
      +  "four-bar",
      +  "gear-pair",
      +  "belt",
      +  "tendon"
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / pose / type
      Added value: +"object"
  5. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "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"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  6. 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"
      +      ]
      +    }
      +  }
      +]
  7. 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": {}
      +  }
      +]
  8. 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": {}
      -  }
      -]
  9. 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": {}
      +  }
      +]
  10. 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"
      +}
  11. 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"
      +]
  12. 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>]\"."
  13. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true and destructiveHint=false, yet the description still adds real behavioral facts: 'All durably edit source and need { code, assembly_binding }' and 'Each relation fails closed on its own missing required params.' That fail-closed validation contract and the durability of the write are not derivable from the annotations. It does not describe the response shape, but an output schema exists.

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 when-to-use clause is front-loaded, followed by a tight bulleted enumeration of the three modes and a short paragraph on shared requirements. Every line carries information. The dense parenthetical payload signatures are slightly heavy but map directly to call construction.

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?

For a 23-parameter, nested-object, enum-bearing mutation tool, the description covers the mode selector, each mode's required fields, the shared prerequisite ({ code, assembly_binding }), the naming convention, and the failure mode. With an output schema present, return values need not be described. Only the absence of sibling routing keeps it from full completeness.

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 the schema already documents every parameter; baseline would be 3. The description earns above baseline by explaining the casing translation ('the inserted script keeps limitsDeg, limitsMm, sourceMate, drivenMates; pass limits_deg, limits_mm, source_mate, driven_mates'), which prevents a real class of caller error not visible from the schema alone. It also restates which parameter set each relation needs as a coherence check across 23 params.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: 'author a mate-graph relationship into the source'. It then sharply partitions the tool into three named relation modes ('mate', 'coupling', 'transmission') with their payload shapes, so an agent knows exactly what gets created. It does not explicitly contrast itself with close siblings like add_constraint or add_connector, so it stops short of a 5.

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?

'Use this when you need to author a mate-graph relationship' plus the per-relation bullet list tells the agent which mode to select and what each requires. The default ('relation' defaults to 'mate') is stated. There is no when-not-to-use guidance and no routing to alternatives for constraint-style work.

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.