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?, 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

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

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / pose / type
      Added value: +"object"
  3. 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"
      -]
  4. 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"
      +      ]
      +    }
      +  }
      +]
  5. 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": {}
      +  }
      +]
  6. 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": {}
      -  }
      -]
  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
    • 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"
      +}
  9. 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"
      +]
  10. 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>]\"."
  11. First observed

TDQS

A3.9/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, so the mutation profile is covered. The description adds genuinely new context: every call durably edits source, requires code and assembly_binding, and each relation fails closed on its own missing params — behavior an agent cannot infer from the annotations.

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?

Front-loaded usage sentence followed by a tight bulleted breakdown and one closing constraint sentence. A few required-field names are repeated verbatim from the schema, but the structure is efficient and scannable for a 22-param tool.

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?

For a highly branched tool with 22 params and an if/then schema, the description conveys the discriminating information — which relation to pick, what each minimally needs, that code and assembly_binding are always required, and that edits are durable. Return values are covered by the output schema, so nothing essential is missing.

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 baseline is 3. The description still adds value by compactly restating the minimal required payload per relation and noting that 'relation' defaults to 'mate' and that all other params are forwarded verbatim, which tells the agent the wrapper is not validating relation-specific fields.

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?

States a specific verb and resource — authoring a mate-graph relationship into the source — and decomposes it into three named relation variants with their payloads. It does not explicitly differentiate itself from siblings such as solve_mates or add_constraint, so an agent must infer that this creates relationships rather than solving them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/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 into the source" gives an implied trigger, and the three bullets help pick a relation. There is no explicit when-not guidance or pointer to the natural follow-up (solve_mates) or to alternatives for constraint/workflow authoring.

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.